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:

Get a list of all level names


Recommended Posts

Hello,

 

I'm starting a new NetHook and saw how to get a list of levels in a NetHook example project. But I was having trouble locating a way to get a list of all the levels even if they do not contain geometry or a name. Is there an API call for this? I've been looking through the API Reference Guide but have had trouble finding anything. Any help would be greatly appreciated. Thanks.

Link to comment
Share on other sites

Hello,

 

I'm starting a new NetHook and saw how to get a list of levels in a NetHook example project. But I was having trouble locating a way to get a list of all the levels even if they do not contain geometry or a name. Is there an API call for this? I've been looking through the API Reference Guide but have had trouble finding anything. Any help would be greatly appreciated. Thanks.

 

I'll ask the obvious, why would you need a list of levels that contain nothing? If I recall, and someone can correct me if I am wrong, we allocate a huge amount of empty levels when a drawing is opened or created.

Link to comment
Share on other sites

I'm trying to create a NetHook that will renumber levels like the "Renumber Tools" does in the toolpaths manager. The programmers here want

to be able to renumber levels based on these options:

 

All Levels

Visible Levels

Non Visible Levels

 

I'm just trying to make sure the NetHook accounts for everything so I don't have to skip levels that don't have geometry or a name assigned to them.

Link to comment
Share on other sites

Give me a couple and I'll test something

 

Edit: Actually you will get all levels that have either a name or contain geometry or both, if there is nothing named and no geometry the level essentially doesn't exist, at least that's how I see it. If you create some new levels with nothing on them then save the drawing they are removed.

Edited by Mick from CNC Software Inc.
Link to comment
Share on other sites

Ok, thanks Mick. I'll just have to let the guys know that they won't be able to use it on empty or unnamed levels.

 

Just to be clear, if a level has either a name or geometry or both that is fine and I am pretty sure that covers everything for you. If you find this not to be the case feel free to send me a sample drawing (if possible) and I'll take a closer look.

Link to comment
Share on other sites

I think if you collect the level # of all levels matching the criteria above (has either a name or geometry or both) and subtract from the 255 ones (Not sure if MC still uses the 255 limit) you can determine which ones are free...

 

Put them in an array and compare these arrays against each other...

Link to comment
Share on other sites

I think if you collect the level # of all levels matching the criteria above (has either a name or geometry or both) and subtract from the 255 ones (Not sure if MC still uses the 255 limit) you can determine which ones are free...

 

Put them in an array and compare these arrays against each other...

 

 

I think if you collect the level # of all levels matching the criteria above (has either a name or geometry or both) and subtract from the 255 ones (Not sure if MC still uses the 255 limit) you can determine which ones are free...

 

Put them in an array and compare these arrays against each other...

 

I believe Mastercam currently allows for a billion levels or something crazy like that.

 

Pretty sure your bases are covered.

 

Dim activeLevels = Mastercam.IO.LevelsManager.GetActiveLevelNumbers()

Dim levelsWithGeometry = Mastercam.IO.LevelsManager.GetLevelNumbersWithGeometry()

Dim levelsWithNames = Mastercam.IO.LevelsManager.GetLevelNumbersWithNames()

Dim visibleLevels = Mastercam.IO.LevelsManager.GetVisibleLevelNumbers()

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