Register now to participate in the forums, access the download area, buy Mastercam training materials, post processors and more. This message will be removed once you have signed in.
Use your display name or email address to sign in:
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
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
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
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 Manager
however 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
eMastercam - your online source for all things Mastercam.
Together, we are the strongest Mastercam community on the web with over 56,000 members, and our online store offers a wide selection of training materials for all applications and skill levels.