Jump to content

Welcome to eMastercam

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:

chook drafting note - help


Recommended Posts

Hi,

 

In trying to enter a note via chooks. I want to enter a note and I know that using v8_note is the way to do it, but I don't know how to do this.

 

code:

typedef struct              /* structure for notes */

{

byte type; /* 0=witness, 1=leader, 2=label, 3=note */

p_3d ref_pt; /* reference point (text in view) (Z=depth) */

short view; /* view number that note was created in */

real scale; /* internal scale for detail view */

font_attr params; /* font attributes */

ulong mtid; /* memory table index (allocated string) */

v8_wit_ldr ldr; /* leader/witness associated with entity */

eptr_type xptr; /* conversion pointer: note (always null_eptr) */

boolean assoc; /* this entity uses associativity */

p_3d txtpos; /* incremental position used to regenerate note */

short ldr_count; /* number of leaders */

byte pad[2]; /* pad to 8 bytes "none" */

} v8_note;

I am getting stuck when I run into this "ulong mtid; memory table index ", what is a mtid and how do I get one. I also found a bunch of memory table functions "mTable..." in "M_DRAFT.H", but there is no intuative way of using these.

 

Does someone know how to make use of all this. I just want to enter a note in my draft.

 

Girus.

Link to comment
Share on other sites

Here's a simple note routine I use

 

Bryan smile.gif

 

code:

/**********************************************************************/

/* MAKE NOTE */

/**********************************************************************/

void make_note(

short view, // I: view to create in (view must be >= 1)

p_3d ref_pt, // I: base point relative to view (and alignment) (z = depth)

byte color,

byte level,

char *text) // I: text for note

{

//note def

ent entity;

db_ptr_type d_ptr;

boolean succf;

 

//initialize note entity

InitNOTE (&entity);

calc_note(&entity, view, ref_pt, text);

store_ent (&entity, &d_ptr, 0, color, level , main_attrib, &succf);

 

}

/**********************************************************************/

/* END MAKE NOTE */

/**********************************************************************/

Link to comment
Share on other sites

Bryan,

 

I am getting this now.

 

error C2664: 'unsigned char (ent *,short,double [],unsigned char *)' : cannot convert parameter 4 from 'char *' to 'unsigned char *'

 

 

on the char*text

 

have you ran into this?

 

Girus.

Link to comment
Share on other sites

Girus,

Look in M_DRAFT.H at DraftGlobalsSave, DraftGlobalsRestore, and the other DraftGlobals functions. They might be of some use to you. You can backup your globals, change font size and stuff, initialize/create your note, and then restore them back to normal.

 

or just modify the values in entity.u.n.params before calling store_ent. Params is a font_attr struct defined in M_VARS.H.

 

for example:

entity.u.n.params.height = 0.25;

entity.u.n.params.chr_exp =0.50;

 

Bryan smile.gif

Link to comment
Share on other sites
  • 4 months later...

Not entirely sure but try the function get_ttfont_number in M_DB.H.

 

Bryan smile.gif

 

code:

 /* ________ get_truetype_font_number _______

*

* Given a true type name, italic & weight, search list and find a font

* number. If the font is not found, create a new font and add to the

* ttfontlist array.

*/

EXTERN int (*_get_ttfont_number) (// return: Font number or -1 if error

char *fontname, // I: Font name

unsigned short italic, // I: Italic

unsigned short weight); // I: Weight of font

#define get_ttfont_number (*_get_ttfont_number)


Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.

Join us!

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.

Follow us

×
×
  • Create New...