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

Delete unused pens 2

SOLVED
Highlighted
Regular Member

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!

Tags (2)
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: Delete unused pens 2

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
Highlighted

Re: Delete unused pens 2

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

Highlighted

Re: Delete unused pens 2

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

Re: Delete unused pens 2

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.

Highlighted

Re: Delete unused pens 2

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

Highlighted

Re: Delete unused pens 2

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

Highlighted

Re: Delete unused pens 2

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

Highlighted

Re: Delete unused pens 2

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.

Highlighted

Re: Delete unused pens 2

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!

Highlighted

Re: Delete unused pens 2

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

Announcements