Skip to main content
1-Visitor
November 9, 2010
Question

Export CGM macro

  • November 9, 2010
  • 2 replies
  • 3514 views

I have what is probably a simple question that has me stumped. I am working on a macro that resizes my drawing size and then resizes the elements to fit in the new drawing. I then want to export the file out to a CGM file. I do not want to add the filename manually, I want to be able to put the ActiveDoc.name in the command "EXPORT". What I need help with is how do I have the "Path" portion of the EXPORT command use the ActiveDoc.name in the path?

Thanks for any help,

Keith

    2 replies

    12-Amethyst
    November 9, 2010

    Sorry for the delay. Busy day.

    Below you'll find a macro that should do what you want. What I've found by trial and error is that when you use any of the macro commands that require multiple specifications, you can't build the string in that command. In this case, build your string for the path and assign to a variable. Then use the variable in the export command.

    Macro CGM_Export

    #Define variables.
    Define MyPath as String
    Define FullPath as String

    #Build path string.
    MyPath = "C:\temp\"
    FullPath = MyPath + StripExt(ActiveDoc.Name) + ".cgm"

    #Export CGM.
    Export FullPath "CGM"

    End Macro

    JB991-VisitorAuthor
    1-Visitor
    November 15, 2010

    Trevor,

    Thank you for your help. Being new to IsoDraw and their macros your help is greatly appreciated.

    One thing I was able to do on this macro is we always save our files as CGM files. So I set my preferences up to always save as a CGM file. This helps with the macro I am writing I just now have to remember to do a save as when I need to keep the ISO file.

    Keith

    1-Visitor
    April 28, 2014

    Hi Jessica,

    your comment "a macrothat resizes my drawing size and then resizes the elements to fit in the new drawing"

    Did you manage to build that macro successfully. Which version of Isodraw did you use?