rm_titus
-
Posts
40 -
Joined
-
Last visited
Content Type
Profiles
Forums
Downloads
Store
eMastercam Wiki
Blogs
Gallery
Events
Posts posted by rm_titus
-
-
Thanks Roger!
I'm working with Notes (v8_note).
The structure font_attr is defined
code:typedef struct
{p_2d center; /**< center point of arc */double str_rot; /**< string rotation angle */double slant; /**< slant angle */double chr_rot; /**< character rotation angle */double height; /**< height of character */double chr_exp; /**< character expansion factor(based on height)*/double extra_sp; /**< extra char. space facter per unit of height*/double extra_ln_sp; /**< extra line space factor */double alt_height; /**< height of character */double alt_chr_exp; /**< alt char. expansion factor(based on height)*//* 2 bytes */unsigned short alt_color:4; /**< draw color */unsigned short fill_color:4; /**< fill color */unsigned short h_txt_aln:2; /**< hort. align.(0-left,1-center,2-right)*/unsigned short v_txt_aln:3; /**< vert. align.(0-top,1-cap,2-half,3-base,4-bottom) */unsigned short path:3; /**< text path (0-right,1-left,2-up,3-down,4-arc CW, 5-arc CCW); *//* 2 bytes */unsigned short space_sty:1; /**< spacing style(0-fixed,1-proportional)*/unsigned short fill:1; /**< fill region flag */unsigned short mirror:2; /**< mirror flag (0-no mirror, 1-mirror x,2-mirrory,3- mirror both)*/unsigned short filler:12; /**< not used at present, here for alignment *//* 4 bytes */MC_BYTE font; /**< display font */MC_BYTE alt_font; /**< alternate display font */MC_BYTE text_bx; /**< text box draw flag for top */MC_BYTE pad; /**< Pad end of structure */} font_attr;The 'Character Width' must be one of those elements but don't know which one.
--Titus
-
Hello guys,
In the "Drafting Options" dialog, under the
option "Dimension Text" there is a textbox called "Character width".
Is that value saved or not in the database?
Do you know of a way to retrieve that value?
Thanks a lot!
--Titus
-
That's GREAT!!
I was using get_hasp_info() function but your code is MUCH better !!
Thanks a lot Roger
--Titus
-
Thanks Roger !!
I'm not mixing Release and Debug code, it was just a quick test to see what's happening when the library mastercam.exe is the one in sdkdebug folder.
I'm doing a C# Windows Form Application straightforward, having a textbox and a button on it so it's not a NET-Hook and Mastercam is not running. I need to know the type of the user without having to open Mastercam.
I keep getting that exception whenever McamX2-MR2mastercam.exe is used.
Thanks,
--Titus
-
If I'm using Mastercam.EXE located into sdkdebug directory, everything works great.
Hopping this help to understand my meaning...
--Titus
-
Thanks Roger for your assistance but still getting AccessViolationException and don't understand why.
My mastercam's file version is 11.2.3.22
--Titus
-
Thanks a lot Roger !
Well, initially, I wanted just userType but having more details is better
Now I'm trying to implement get_user_type() into a standalone application, with this declaration
code:[DllImport("mastercam.exe", EntryPoint = "?get_user_type@@YAFXZ")]
public extern static short get_user_type();but I'm getting an AccessViolationException when calling.
Anything wrong in my declaration ?
Thanks
--Titus
-
Hi guys,
I'm using finally
code:[DllImport("SimAccess.dll", EntryPoint = "?get_hasp_info@@YAXDPAUmcSimInfo@@@Z")]
public extern static void get_hasp_info(sbyte countLicenses, mcSimInfo* sim);with[structLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]public struct mcSimInfo{public sbyte netHasp;public sbyte netHaspNetwork;public long serialNumber;public short timeLimitOK;public sbyte timed;public short daysLeft;public ushort timedStartDate;public ushort timedEndDate;public short userType;public int nMillSeatsLicensed;public int nMillSeatsLeft;public int nLatheSeatsLicensed;public int nLatheSeatsLeft;public int nWireSeatsLicensed;public int nWireSeatsLeft;public int nDesignSeatsLicensed;public int nDesignSeatsLeft;public int nRouterSeatsLicensed;public int nRouterSeatsLeft;public sbyte maintenance;public short maintDaysLeft;public short maintDateOK;public ushort maintExpirationDate;}--Titus
-
Thanks Roger !
I'm actually doing a C# application and I need to import that function.
--Titus
-
Hello guys,
Does somebody knows in which DLL the entry point get_user_type is located ?
Thanks a lot !
--Titus
-
Hello guys,
I just did the same test and it appears the 'opRef.operationTool' member is always null.
Wrapping this in a try/catch block will return the reason of the exception.
On the other hand, I did notice that using
code:COperationRef opRef = new COperationRef(opID);
this will return a non null member.
Could this be a workaround in the meantime ?
--Titus
-
Hello Blusterday,
I'd have a quick suggestion for you.
Within your computer running Win XP Pro, try right-clicking on that batch file, then Properties. Afterwards, go onto the Compatibility tab and check the option "Run this program in compatibility mode for Windows 98/Windows Me"
HTH,
--Titus
-
Hi guys,
FYI, I found the issue. I was doing this as Takashi suggested, I mean
code:strcpy( op.u.chook.opmgr_txt, "my chook toolpath!!!");
strcpy( op.u.chook.chook_name, "chook.dll");strcpy( op.u.chook.opmgr_prm, "ParametersFunction"); // chook's function to call when op's parameters are selected in the Operation Managerhowever my function ParametersFunction wasn't declared as
code:extern "C" __declspec(dllexport)
Thanks for your help !!
--Titus
-
Hello guys,
Just a quick update, I found I could use
DllImpExp void set_init_op_use_prev_op_same_type ( MC_BOOL use_prev_op )
in order to copy other operation data, however the challenge would be to be able to set every property upon creation of an operation as Takashi suggested.
The issue I'm having actually is that setting these properties individually, I'm getting errors like "Program entry point not found" rather than performing tasks.
Any hint will be really appreciated !! Thanks !
--Titus
-
Hi guys,
I'm trying to play with the struct prm_chook when creating a new operation.
Takashi already suggested roughly how the creation of a new chook operation could be done in the following thread
http://www.emastercam.com/ubb/ultimatebb.p...t=000416#000001
Have someone used these members succesfully :
code:chook_name, opmgr_prm, opmgr_tool, opmgr_geom, regen_nci, opmgr_nciL, opmgr_nciR ?
Thanks a lot !!
--Titus
-
Oh! Thanks a lot guys !! Now I understand better how the versioning works...
I'd have another concern about the deployment of my DLLs. One of my CHooks is calling a .NET library through an unmanaged wrapper. I am able to make everything works only if the wrapper and the .NET library are both placed in McamX2 folder.
Should I use manifest or configuration files in order to load an assembly elsewhere than McamX2 ?
Thanks !!
--Titus
-
Hi arenner
I would try
code:post_dlg_settings my_post_settings;
my_post_settings.save_nci_file = TRUE;my_post_settings.overwrite_nci = TRUE;my_post_settings.save_nc_file = TRUE;my_post_settings.overwrite_nc = TRUE;my_post_settings.send_to_machine = FALSE;my_post_settings.editNCI = FALSE;my_post_settings.editNC = FALSE;my_post_settings.export_oplist = FALSE;my_post_settings.export_prm = FALSE;my_post_settings.wcs_1014 = FALSE;my_post_settings.descriptor = FALSE;HTH
--Titus
-
Hi Mick,
Sorry, in my previous message there was a typo in the directory name. It should have read McamX2chooksmy_application.
As to why I am placing another nethook API in my own directory when there is already one in McamX2, that's a good question...
Well, because I want to ensure my clients are using an up-to-date API and to avoid conflicts with the external context. For example, the NetHook2_0.dll I have in my McamX2, dated Sep. 2006, does not contain the IsOperation() method. The version that I am deploying, dated Dec. 2006, does contain it.
My question is why does my DLL always use the Nethook API which exists under McamX2 rather than using my version ?!
Thanks a lot !
--Titus
-
Hi guys,
I have built a custom DLL which is referencing the new NetHook API.
My own dll as well as the nethook2_0.dll are both installed under the directory McamX2chooks.
I did noticed that my dll is always using the NetHook API existing under McamX2 directory and not the one that I have deployed in the same directory as the application.
Is there something I am missing here ?
Thanks in advance !
--Titus
-
This function belongs to mccore, however not sure if this is really useful to you...though it was just a guess
Here is the declaration
extern void draw_bnci (ulong op_idn, MC_BOOL
blank, MC_BOOL show_tl)
-
Hi arenner,
Did you try ?
code:operation_manager (&op, OPMGR_NCI_REGEN, &opEptr, &succf);
draw_bnci (op.op_idn,FALSE,FALSE);HTH,
--Titus
-
Hello guys,
Everything works like a charm now.
When you encounter an assembly loading problem,
consider using the Assembly Binding Log Viewer
tool that comes with the .NET Framework
(fuslogvw.exe) to determine which dependency
failed to load and why.
Here what I did:
- compile without /clr option (not sure if this could be a potential issue...)
- link with /fixed:no additional switch.
- put all other DLLs in my McamX2 directory (Thanks Roger to pointing this out !!! The DLLs was properly referenced but wasn't placed in the proper directory).
Thanks Roger again for answering !
--Titus
-
I'm not able to reproduce the hang in my test environment because everything works wonderful.
All references are there. Now I'm using just a simple c# DLL that is popping up a "Hello" messagebox.
The wrapper is there as well. I don't see anything wrong with this...
Thanks !
-
Hello,
When I'm trying to load the C-Hook, I'm getting the error message "Could not load file or assembly <...> or one of its dependencies. The module was expected to contain an assembly manifest."
After clicking on "Ok" again, another messagebox "The appropriate Mastercam .NET Support dll could not be found" is popping up
Commenting out that line of code afterwards everything goes well again...
Thanks a lot for your assistance!
--Titus
Character width
in Mastercam C-Hook, NET-Hook and VBScript Development
Posted
Thanks a lot Roger!
Very clear and detailed explanations.