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:

How to retrieve text from note/labels ?


MCHulk
 Share

Recommended Posts

Hi folks,

 

I'm trying to retrieve the text from the notes or labels of the actual loaded MC-Model via a chook. To get the notes/labels is easy, but how to convert the pointer mtid from the structure v8_note to the text.

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 dont know, how to convert back the memory table record to the desired text.

 

Does someone know how to do this.

 

Thanks in advance,

MCHulk headscratch.gif

Link to comment
Share on other sites

If you have the Note-Entity, you get the String with the function mTableFindData.

Try:

 

code:

ent NoteEnt // This is your note-entity

 

char *szNoteTxt // This should be the Note-Text

 

szNoteTxt=(char *)mTableFindData(NoteEnt.u.n.mtid); // Get the void-data-pointer and type-cast it to char-pointer

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...