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:

Renumber Levels?


Mcam Nut
 Share

Recommended Posts

I have created level name sets, which you can save (right click menu). I have groupings based on 1-9, 10-19, 20-29, etc. I use the same names in each set. This way, when I merge files, they come in without over writing existing levels. You do have to keep track of which file used which set, but that's what sticky notes are for...

 

But a re-number utility would definetly be way kool !

Link to comment
Share on other sites

Ask, and you shall receive...

 

Here is a VB script to increment all of your levels. When you run the script it will prompt you and ask you for an increment value. The default is 1000. This would add 1000 to all of your level #'s. So level 1 would become 1001, Level 16 would become 1016, Level 1200 would become level 2200, ect.

 

If you like this, please thank Mick George @ CNC.

 

code:

 

 

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

'//

'// Author: Mick George [email protected]

'// Date: 05/11/2003 04:42 PM

'// File Name: Copy Entities to Level.vbs

'//

'// Description:

'//

'// Comments: Select an entity to get its level, prompt for a new level and copy all

'// entities from current level to new level.

'//

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

 

'

Const DEF_GIVE_ME_EVERYTHING = -1

 

' -- Start Script

Call Main()

 

 

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

' Sub Declaration

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

Sub Main()

 

Dim i,j,k

Dim CArc, CLine, CPoint, CRect

Dim CArcCopy, CLineCopy, CPointCopy, CRectCopy

Dim intOriginalLevel, intNewLevel

Dim bRet

Dim intUpLevel

Dim strLevelName

Dim intMaxLevel

intUPlevel = 1000

intMaxLevel = 0

If Not IsDrawing Then ShowString "We need a drawing": Exit Sub

askValue "How far up?", 1,999999,intUpLevel

 

 

bRet = StartDBSearch(mc_alive, DEF_GIVE_ME_EVERYTHING)

 

Do

 

 

intOriginalLevel = GetEntityLevel

If intOriginalLevel > intMaxLevel Then

intMaxLevel = intOriginalLevel

End If

 

'ShowValue "layer ",intOriginalLevel

strLevelName = GetLevelName(intOriginalLevel)

intNewLevel = intOriginalLevel + intUpLevel

Call SetEntityLevel(intNewLevel)

Call SetLevelName (intNewLevel, strLevelName)

 

bRet = NextDBSearch

 

Loop While bRet

 

Call UnselectAll

Call RepaintScreen(True)

' unname the originals

For i = 1 To intMaxLevel

Call SetLevelName (i, "")

Next

 

End Sub

 

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

' Function Declaration

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

 

Function IsDrawing()

 

Dim Ret

 

Ret = StartDBSearch(mc_alive, -1)

 

UnselectAll

 

IsDrawing = Ret

 

End Function

HTH,

 

Colin Gilchrist

The Boeing Company

MRe and all the fixins...

Link to comment
Share on other sites

On the ftp site in the vb_scripts folder there is IncrementAllLevels.vbs and IncrementAllLevelsWithRange.vbs these work well for merging files.I think I use

IncrementAllLevels.vbs It will move all displayed entities from the level they are on to that level plus increment value.It does not move name to new level though.You will have to edit the script if you want to increment more than 254.

Link to comment
Share on other sites

This might work, and it might not... make backup file to try it

 

Right click in the Level Manager and choose

"Saved Named Levels"

this will crease a CVS file that can be edited in Excel.

Use Excell to edit the numbers feild on the CVS file and save it.

Now right click the level manger and choose.

"Get Named Levels" and picked the edited CVS file.

The Level Manager will change to reflect the Excel edits.

I don't know if the Level Manager levels

will still corespond to their original geomtry

or not. They should, as long as you don't reorder the levels or the Ecxel cvs file before importing the edited CVS file.

 

[ 10-15-2006, 11:59 AM: Message edited by: gcode ]

Link to comment
Share on other sites

Thanks guys, the vb scripts worked out good, I do have one more question though. I figured out how to run the scripts in x, but how do i run it in v9. I am trying to run the script for ge3 to mc9. does this actully work? does it bring in the toolpaths?

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