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:

bryan314

Verified Members
  • Posts

    706
  • Joined

  • Last visited

Posts posted by bryan314

  1. Hi all,

     

    I recently moved over X2 to win7 x64. Chooks that had no issues on XP 32 are now crashing. So far all crashes seem to be related to memory issues. Some I've been able to fix. Others have me stumped.

     

    For example: calling stdc free() (per the documentation) on the data from ps_tag_to_mc_ents(). 2 out 3 chooks this is used, it works fine. The 3rd (and simplest chook) crashes.

     

    The code for the 3 routines is:

    Call ps_tag_to_mc_ents with an edge tag

    loop resulting ent(s)

    if ent meets a criteria, delete it.

    free eptrs array

     

    debug is breaking on the free() or more specifically _ASSERTE(_CrtIsValidHeapPointer(pUserData)); in dbgheap.c

     

    Is there a compiler setting I should be looking for?

     

    Is the stdc free() the wrong function? Several mc api functions provide their own free routine. is the free for ps_tag_to_mc_ents missing from the api?

     

    In the api FREE() seems to be a wrapper for stdc free(). Should I be using m_free() in mastercam? Or something else?

     

     

    Any thought would be appreciated.

     

    Bryan smile.gif

  2. Out of curiosity, when you say 'database' are you saving custom info in the entity database, a separate file, or doing something else?

     

    If you hooking the save event to save to a separate file. I'm guessing, it maybe the redX or sim disconnected is calling MCEVENT_MCEXIT unloading any memory resident chooks before they can see the MCEVENT_PRE_FILE_SAVE.

     

    If you're saving custom data inside the mcx file and mastercam itself is saving the info, no idea. But I'd be your best friend forever if I could learn to save custom data inside a mcx file. smile.gif

  3. Hi Roger,

     

    I've been hiding under a rock for awhile. Buried under a lot of other projects. I'm trying to get back to some chook bugs, upgrades, new chook requests here at the shop.

     

    Thanks for the info. It just occurred to me while using the function there wasn't explicit "you need to clean this up yourself" comment in the doc and I was afraid of a memory leak. Or worse freeing it myself only to have MC do it later and crash. frown.gif

     

    Bryan smile.gif

  4. Yep, We're seeing it too. frown.gif It's kinda annoying.

     

    XP machines.

    With Toolbar icons set both large and small.

     

    If you undock and redock the toolbar it'll temporarily restore the icons. It's a temp solution but better than restarting everytime.

     

    I've already had some email exchanges with QC to figure it out. But No luck yet.

     

    Please report this to [email protected] so they know it's more than one or two people and can get it figured out. wink.gif

     

    Bryan smile.gif

  5. I had another thought if they are dealing with straight geometry convert it to an ascii format like iges and they can run it through normal plagiarism software.

     

    If they're dealing with geometry and toolpaths it should be easy enough to get a chook or vbscript written to convert the significant bits to text and do the same. level, color, time, entity number, radius, length, toolpath comment, feeds and speeds, etc.

     

    Bryan smile.gif

  6. Dave,

     

    I don't see why not. It should be easy enough to go through a directory of files and pull the entity number and creation times and look for and count the matches.

     

    If the student is half way smart though (but if they're copying they can't be too smart) they could reset the numbers and time by importing/exporting the geometry or merging it into a file with existing geometry.

     

    It should also be possible to compare entities looking for full or partial matches based on properties such as color, level, radius, length, etc and spit out a percentage of overlap. A certain percentage would be expected if the students are working on the same part but a higher number might indicate something else.

     

    Bryan smile.gif

  7. Pete,

     

    Thanks Pete. But that seems to do the same as calling

    OnViewPreviousView. I'm looking for a way to set the previous t/c/g views and then call named_view_manager. So that if the user runs previous view/cplane/tplane through mastercam it'll go back to the t/c/g view from before the chook was run.

     

    Either that or named_view_manager should be but isn't setting the 'previous' variables when called with VWMGR_TPLANE, VWMGR_CPLANE, or VWMGR_GVIEW.

     

    But I'm thinking since set_gr_view and set_gview don't set the previous whatever, this is by design and there a separate routine(s) for setting 'previous' before or after calling named_view_manager or set_gr_view or set_gview.

     

    Bryan smile.gif

  8. I did the read_ent thing back in version 8 and 9. It worked great for a couple years.

     

    Simple entities aren't a problem, like points, lines, and arcs (and notes but they take a little work). But trying to do splines, surfs, trimmed surfs, and solids is a MAJOR pain. And some areas like solids are probably impossible given the limited nature of the sdk.

     

    Thanks for the help though. cheers.gif

     

    Bryan smile.gif

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