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:

Use View Clipping planes for geometry selection?


Recommended Posts

Greetings Chook Gurus,

 

Is there a way to use the clipping planes of the current graphics view to select geometry from the Mastercam database?

 

Here is what we are trying to accomplish:

 

We would like to be able to perform a function like "save some", but take only the geometry that is displayed in the current graphics view. Basically we would like to query the Mastercam database, select "All visible entities", then un-select any entity that falls outside our current graphics view's clipping planes.

 

Does anybody know of a method to do this in C++ or C#?

 

Thanks in advance,

Link to comment
Share on other sites
  • 2 weeks later...

it may work. biggrin.gif

code:

 

 

/**

*

* @par Purpose:

* This method sets select bits for entities that lie within the window and

* clears select bits for entities that lie outside the window.

*

* @param[in] corner1 1st window corner, in uu coordinates

* @param[in] corner2 2nd window corner, in uu coordinates

* @param[in] set_ptn bits to set in .sel

* @param[in] clr_ptn bits to clear in .sel

* @param[in] ent_mask compare .id against this mask

* @param[in] draw whether or not to re-draw entity after changing .sel

* @param[in] mode 1= inside, 2= in+intr, 3= intersect, 4= out+intr, 5= outside

* @param[out] succf TRUE if method was succesful; FALSE otherwise

*

*/

extern DllImpExp void mark_window (

p_2d corner1,

p_2d corner2,

USHORT set_ptn,

USHORT clr_ptn,

ULONG ent_mask,

MC_BOOL draw,

short mode,

MC_BOOL *succf);

Link to comment
Share on other sites
  • 2 weeks later...

Satosan,

 

Thanks for the snippet of code, we are trying it now. Pete Rimkus has this to add, I hope it might help you too.

 

quote:

 

The following (from CGui.H) can be used to get the extents of the current graphics view in ‘user units’ (“xh” = X high, “xl” = X low, etc)

 

 

extern DllImpExp double get_xh_clip();

extern DllImpExp double get_yh_clip();

extern DllImpExp double get_xl_clip();

extern DllImpExp double get_yl_clip();

 

 


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