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

Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X

Export CGM macro

JB99
1-Newbie

Export CGM macro

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

3 REPLIES 3
thendricks
3-Visitor
(To:JB99)

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

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

mano
1-Newbie
(To:JB99)

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?

Top Tags