Skip to main content
1-Visitor
December 16, 2011
Solved

Delete unused pens 2

  • December 16, 2011
  • 2 replies
  • 9199 views

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!

    Best answer by VladimirN

    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.

    2 replies

    VladimirN24-Ruby IIIAnswer
    24-Ruby III
    December 20, 2011

    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.

    1-Visitor
    December 20, 2011

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

    24-Ruby III
    December 21, 2011

    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.

    1-Visitor
    January 7, 2012

    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"

    1-Visitor
    January 9, 2012

    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!