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:

Full chaining for selecting geometry


Recommended Posts

Hello,

 

I am trying to use a chain manager for selecting geometry. The reason for this is that a general selection chaining [sHIFT+CLICK] is not working well enough on complex 3D parts (it stops chaining on branches).

 

For now I have been trying with some VB functions and all I could do was to save chained elements to a geometry group. From here on I can not find a way to make all the elements in this group active so I could use them in some other function (like project this geometry to a Z=100).

 

Here is my code:

 

code:

 

Call Main()

 

Sub Main()

Dim result, result1, prev_result1

 

' open the chain manager

result = AskForChain("test")

result1 = GetEntityEptr()

 

' go through all the elements in the chain and save them in the geomtry group "TEST"

' when previous EntityEptr is different than current EntityEptr

' it means that I have not reach the and of chain yet

While result1 <> prev_result1

prev_result1 = result1

result1 = AddCurrentEntToGroup("TEST")

result = MoveForwardOnChain()

result1 = GetEntityEptr()

wend

Call RunFTCommand("MASTERCAM", "SelectAllMask") ' this one is not working

End Sub


Has anybody tried to do something like this?

Is it even possible by using VB or would I have to use .NET or even C++?

 

Regards

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

Hi,

 

I copied and pasted your codes into my X4 and ran it. Nothing happened. I tried to find out what command "RunFTcommand" is in the VB help but I cannot find it.

 

Then I blanked above line and add a new statement: "MakeContour". It generate a chain in the Operation Manager Box. Below are the codes,

 

Call Main()

Sub Main()

Dim result, result1, prev_result1

Dim id

' open the chain manager

result = AskForChain("test")

result1 = GetEntityEptr()

' go through all the elements in the chain and save them in the geomtry group "TEST"

' when previous EntityEptr is different than current EntityEptr

' it means that I have not reach the and of chain yet

While result1 <> prev_result1

prev_result1 = result1

result1 = AddCurrentEntToGroup("TEST")

result = MoveForwardOnChain()

result1 = GetEntityEptr()

wend

'Call RunFTCommand("MASTERCAM", "SelectAllMask") ' this one is not working

id=MakeContour("",0,0,1,mctool_flat,mccutter_comp_left,mccutter_roll_none,80)'

 

End Sub

 

Try yourself and see if it is what you need.

 

Thanks

 

Kevin

Link to comment
Share on other sites
  • 1 month later...

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