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:

VBS RunMCommand & Delete Questions


Recommended Posts

I have a couple questions this time around.

1)The VB Script I am currently working on requires me to delete all splines on a given level. I have not found a way to do this. Any Suggestions?

 

2)My next question is when using “Call RunMastercamCommand("xxx")” The only way I can get this to work is by putting a ShowString right after it. I have tried putting a for-next loop in after the command with the counter up at 200000000 and the RunMastercamCommand still didn’t work.

 

Example code:

SelectAll ()

ShowString ("Enter to continue")

Call RunMastercamCommand("simplify")

ShowString ("Enter to continue")

Call RunMastercamCommand("CombineViews")

Showstring ("Enter to continue")

 

 

Every ShowString requires the operator to hit the enter key and I would very much like to avoid that.

Any Suggestions?

Link to comment
Share on other sites

Hello

 

1)I wrote the code below.

can you try it?

 

GetEntityLevel

 

code:

 ' -- Start Script

Call Main()

 

 

' ////////////////////

' Sub Declaration

' ////////////////////

Sub Main()

 

Dim bRet

 

' -- Start our search

bRet = StartDBSearch(mc_alive, 8 Or 128)

Do While bRet

'If GetEntityLevel = 1

DeleteEntity(GetEntityEptr)

' -- Get another entity

bRet = NextDBSearch

Loop

 

Call RunMastercamCommand("OnScreenRegenerate")

 

End Sub

 

 

 

 

 

----------------------------------------------

 

 

 

 

this is from chook sdk

 

#define P_ID (ulong)1 ///< Point (bit 0)

#define L_ID (ulong)2 ///< Line (bit 1)

#define A_ID (ulong)4 ///< Arc (bit 2)

#define S_ID (ulong)8 ///< Parametric spline (bit 3)

#define N_ID (ulong)16 ///< Note/Label (bit 4)

#define W_ID (ulong)32 ///< Witness/Leader (bit 5)

#define D_ID (ulong)64 ///< Dimension (bit 6)

#define NB_ID (ulong)128 ///< NURBS curve (bit 7)

#define SURF_ID (ulong)256 ///< All surfaces (bit 8)

#define DB_ID (ulong)512 ///< Database management (bit 9)

#define CONS_ID (ulong)1024 ///< Curve ON Surface (bit 10)

#define CD_ID (ulong)2048 ///< Copious data (bit 11)

#define XH_ID (ulong)4096 ///< Crosshatch (bit 12)

#define CC_ID (ulong)8192 ///< Composite curve (bit 13)

#define ASSOC_ID (ulong)16384 ///< Associative ents (bit 14)

#define CHILD_ID (ulong)0x8000 ///< Nonzero: ignore back pointer (bit 15)

#define SOLID_ID (ulong)0x10000 ///< Solid entity (mc_solid_ent) (bit 16)

#define SOLIDXMT_ID (ulong)0x20000 ///< Solid .x_t file (mc_solid_xmt_ent) (bit 17)

#define FILE_ID (ulong)0x40000 ///< File entity (bit 18)

#define RELIEF_ID (ulong)0x80000 ///< Art Relief Info entity (bit 19)

 

 

 


2)it seems "simplify" command does not support pre-selection.

so you may have to hit enter key..

 

 

HTH smile.gif

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