cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X

Delete unused pens 2

FrancisPaille
7-Bedrock

Delete unused pens 2

Hi everybody, is there anyone who can help me on this one...

A would like to create macro to clean all unused pens, but without touching our custumize pen? is there anyway to create that macro???

see on file attached the list of pens, we would like to keep all pens from the top to center line 2.

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions

Hello!

I create a macro for you (in Arbortext IsoDraw 7.1 M070), check it out. The macro file needs to be placed in a following folder: "C: \ Documents and Settings \ UserName \ Application Data \ PTC \ IsoDraw \ Macros" (I use on Win Vista 32-bit the following way: "C: \ Users \ user \ AppData \ Roaming \ PTC \ IsoDraw \ Macros "). Also the given macro can be added as the button on the panel 3D Tools and to use it as a command - see attach.

View solution in original post

11 REPLIES 11

Hello!

I create a macro for you (in Arbortext IsoDraw 7.1 M070), check it out. The macro file needs to be placed in a following folder: "C: \ Documents and Settings \ UserName \ Application Data \ PTC \ IsoDraw \ Macros" (I use on Win Vista 32-bit the following way: "C: \ Users \ user \ AppData \ Roaming \ PTC \ IsoDraw \ Macros "). Also the given macro can be added as the button on the panel 3D Tools and to use it as a command - see attach.

Hi Vladimir, Thanks a lot for your help, it works fine.

Is it possible to modify the macro to create variable for all the pen than a whant to delete???

I explain... we deal with many software, and as exemple we have to do isometric illustrations with the 3D extract from Catia V5 in cgm. Each time a incorporate those detail from V5, new pen name are created, so we re-use those detail, modify artworks, and at the end we are allow to use only the pen as mention on previous post, so all pen created from cgm are now to be deleted because we substitute by using the one on our standard.

So we are trying to create macro (witout good result) to delete all pens, who could be different, but keep the one as mention on previous mail who is on ous standard frame.

We do it manually for to long, i am sure they have a way to do it faster, to save time and effort!!!

But we need expert help on that!!!

Many thanks, i apreciate a lot your support!!!

What version of Arbortext IsoDraw are you using? Has attached to the message following files:

"Arbortext IsoDraw Macro Language Reference 7.1".pdf

"Arbortext IsoDraw Macro Language Reference 7.2".pdf

It seems that for an illustration only two types of unnecessary pencils were used: "102" (0,004 in) and "152" (0,006 in). You can add other types of pens in macros.

We use 7.1 M060

The problem we have, is the pen used in detail from the other software are always different, so each time we incorporated detail we add new pen in same time. We need those pen to isolate part like to seperate structure from part in different layer in our artwork, but at the end we need to deliver job cleen without unuse pen but keet std pen in illustration for future revision.

I already try to buid more complex macro by using the macro language reference pdf, but my skill are limited to std things.I am in the stage to re-use existing macro by trying to understand the language used and modify for my use, so very limited...

If I am understanding correctly, perhaps using the macro provided delete unused pens and then the attached would get you where you need to go. If I'm off on the approach, disregard.

Here was our situation. We hadour production files as EPS files created by Adobe Illustrator 10. Once we moved to IsoDraw we of course had to convert. Obviously, not everything comes over clean. Our standard lines from Illustrator came over as various incarnations (generally by our illustrators creativity through the years). As a clean up, we use a macro to first eliminate the unused pens. Then, the next macro is listed as a sub. This goes through and selects all pens that start with a zero. It then selects them on screen so you know where they are used. You can then type the number of the pen you want to use (if you look at the pens available you'll see the first couple are numbered, just keep going with the numbering if necessary). It then changes the pen of the select elements and deletes the old pen. It's not completely automatic, but without getting very complex it serves its' purpose.

Macro Pen_Replacement

Define p as Integer
Define GoodPens as String
Define BadPen as String
Define Replacement as Integer
Define NewPen as String

Zoom Page

Run Delete_Unused_Pens

Select None
Wait Timer 1

#Sets values of variables.
i = ActiveDoc.PenCount

p = 1

#Starts loop that goes through all existing pens.
While ((p <> i + 1) = True)

Select None
Wait Timer 1

If (Left(ActiveDoc.Pens[p].Name, 1) = "0") then
BadPen = ActiveDoc.Pens[p].Name
Select if Pen is equal to BadPen
Replacement = Get Integer "Replace selected lines with:" + $NewLine + GoodPens
NewPen = ActiveDoc.Pens[Replacement].Name
Delete Pen BadPen NewPen

#Reduce number of overall pens because of pen deletion.
i = ActiveDoc.PenCount
Else
p = p + 1
End If

End While

Select None

End Macro

Hi Trevor, thanks again for your support it is much appreciated, i learn a lot fromanalysing your macro, with the reference macro guide it is not easy for a newbe, we need some exemple in context as your helpful exemple!

Your macro work perfecly, to much... it delete our std pens!!! we need to keep those std pen as shown on our frame template submited. Those pens never change on our illustration, whatever if it is use or not should stay in file for futur revision.

What it should be the best and easyer as a see the problem, is probably to build macro to delete all pens after the last one on our std frame who is

Center line 2. I specify than we keep all our std pens in order.

So from your advise, it is possible to built something like that???

A couple different approaches.

1) You could add to the macro to specifically skip your standard pens. Kind of a pain, but doable.

2) Run so all pens are deleted and then use the macro to set your standard pens back up.

3) Elsewhere on the forum you'll find a macro called Update_Pref that basically copies your current file to a new file resetting your preferences. If you first use the delete unused pens and then run this macro it would delete the pens but then add them back assuming your pens are part of your default preferences.

Your approach may dependant on the number of custom pens. If it's only one, #1 or 2 (or maybe even 5) above would suffice. If you're getting higher, I'd recommend #3.

The approach # 2 is the best for us, whatever we used in the past will be set correctly for the future.

It looks very nice for me but feasable with my skill.

If you could help me with that it will be much appeciated!

Tanks!

Corrected previous macro (removed error message in the end of the procedure).

Hello Francis Paille

I think This would help you,

Macro Delete_Other_then_standard_pen

Define pen1 as String
Define pen2 as String
Define pen3 as String
Define pen4 as String
Define pen5 as String
Define pen6 as String
Define pen7 as String
Define pen8 as String
Define pen9 as String
Define pen10 as String
Define pen11 as String
Define pen12 as String
Define pen13 as String
Define pen14 as String
Define pen15 as String
Define pen16 as String

pen1 = "Thick"
pen2 = "Medium"
pen3 = "Thin"
pen4 = "Center line"
pen5 = ".004"
pen6 = ".024"
pen7 = "fleche>"
pen8 = "fleche"
pen9 = "flefleche"
pen10 = "pointeur"
pen11 = "pointiller"
pen12 = "frames"
pen13 = "wh004"
pen14 = "wh008"
pen15 = "Fantome"
pen16 = "Center Line 2"



Define pen_count as integer
pen_count = ActiveDoc.PenCount
Define delete_pen as string
Define n as integer
Define i as integer

n = (pen_count + 4)

For i = 1 to n
delete_pen = ActiveDoc.Pens[pen_count].Name
if (delete_pen = pen16) Then
Else
If (delete_pen = pen15) Then
Else
If (delete_pen = pen14) Then
Else
If (delete_pen = pen13) Then
Else
If (delete_pen = pen12) Then
Else
If (delete_pen = pen11) Then
Else
If (delete_pen = pen10) Then
Else
If (delete_pen = pen9) Then
Else
If (delete_pen = pen8) Then
Else
If (delete_pen = pen7) Then
Else
If (delete_pen = pen6) Then
Else
If (delete_pen = pen5) Then
Else
If (delete_pen = pen4) Then
Else
If (delete_pen = pen3) Then
Else
If (delete_pen = pen2) Then
Else
If (delete_pen = pen1) Then
Else
Select if Pen is equal to delete_pen
Set active pen "No pen"
Delete pen delete_pen
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
pen_count = ActiveDoc.PenCount
End For
End Macro

Note: If any eny element is available in the non-standard pens, it will be moved to "No pen"

Thanks Vaduga,

It is exactly want a was seaching for. I just change the the non standard pen switch to .004 for my personal use, it is more convenient.

I big thumbs up for you!!!

I appreciate a lot your help!

Top Tags