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

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

Isodraw 7.1 Macro query


Isodraw 7.1 Macro query

Hi all,


I am new to this so please be patient.


Below is a macro I created. I have added statements to explain what is happening throughout and It works fine if I load a CGM into isodraw and then run the macro.

The problem comes when I call the macro from the batch process tool. That's where it crashes and burns. I have also tried running this from the command line but the same thing happens.


It is pretty clear to me that closing the document is causing the batch tool to go down. So if anyone knows some extra code I could use to just loop within my macro the number of times, equivalent to the number of CGM in my source directory I think it would do the trick.

Any ideas would be appreciated.


One other question: is there a line of code I can use to lock and unlock certain layers?




Macro test


#Save original document number as string.
DEFINE doc AS string
doc = 'ICN-' +

select all

MESSAGE "the file's full name is: " + doc

Group Selection

##########works up until here using batch programme###################


#Closes source document


#hard coded to open official Project Pageframe
Open "C:\Batchin\951pageframe.iso" = doc
ACTIVATE LAYER "Standard layer"


#Delete existing blank ERM and ICN numbers
Select if Text contains 'ERM'
Delete selection
Select if Text contains 'AAAAAA'
Delete selection

Ungroup Selection


DEFINE path AS string
path = 'C:\Batchout\'

#MESSAGE "File will be saved as: " path + name + extension

Save path + doc

End Macro


#Format for running from command line and saving as base iso format
#IsoDraw71.exe -batch -s"C:\Batchin" -d"C:\Batchout" -f0 -m"test"


Only partial answers here unfortunately.

In regards to a method to have the macro cycle through...seemed like I had a better way of doing this before, but here is a screwed up approach since I can't remember

Sudo code:

  1. Add a new text element on an empty page (doesn't matter where).
  2. Populate it with a unique piece of text (something easy to find later).
  3. Export text (you could use xcf if you prefer, but you'll need to add object info to the text so that it exports).
  4. Once the file is exported you can use your unique text (ref #2) to find the line you want to edit. Then use cmd or whatever to get a directory listing.
  5. Once your file has the updated directory listing for that text element you can open the text file.
  6. The variable will now contain your listing. There is a character limitation, but you should be able to get fair sized loads like this anyways.
  7. Parse the element with the string tools to loop through all the names running your submacro.

Sounds like overkill but at the moment that's what comes to mind.

In regards to layer locking, no one line code that I'm aware to lock all but one. You'll need to loop over the layers.

macro layerLoop

     Define i as Integer

     Define CurrentLayer as Layer

     Define LayerName as String

     i = ActiveDoc.LayerCount

    CurrentLayer = ActiveDoc.Layers[i]

    While (Exists(CurrentLayer) = True)

          LayerName = CurrentLayer.Name

          ActiveDoc.Layers[LayerName].Exportable = False

          ActiveDoc.Layers[LayerName].Printable = False

          CurrentLayer = CurrentLayer.PreviousSibling

    End While

end macro

This macro has not been tested but the intent is turn exportability and printing off for each layer. Mod for you purposes. In order to turn one layer on (or off), just add a check of the LayerName to skip what you design. If you'll use this a lot, set it up as a submacro, add a global variable for the layer you want to turn on/off. You can then set the variable and call the submacro whenever needed.

Top Tags