I have a text file with coordinates for a number of shape symbols that I need to create. My problem is how I inside skill can create a new .dra file and then draw the shape and save the .dra/ssm file.
I've look at numerous axl functions without getting something to work - does anyone have an idea?
I could probably create scripts to generate new shape symbols and save them using scripts, but I would rather avoid using scripts.
Have you tried "axlDBCreateSymDefSkeleton"? I've use this to create new symbols in a design.
If I understand your problem correctly you want to create a symbol without leaving your current design session?
I can't think of a non-script way to do that but I get around the problem with a series of tricks to save my current design, open the symbol editor, create my symbol and re-open the original design:
draName = "myDra" currentDesign = axlCurrentDesign() state = axlSaveEnable() tempDesignName = "temp.brd" axlSaveDesign(?design tempDesignName, ?mode "nocheck", ?noMru t) AFn_OpenDesign(?design strcat(draName, ".dra"), ?mode "wf", ?noMru t, ?noConfirm t, ?forceNew t) axlSetSymbolType("shape") ;... AFn_OpenDesign(?design tempDesignName, ?mode "wf", ?noMru t, ?noConfirm t) axlSaveDesign(?noMru t) axlRenameDesign(currentDesign) deleteFile(tempDesignName) axlSaveEnable(state)
defun( AFn_OpenDesign (@key design, (mode "w"), noMru, noConfirm, forceNew) let((noconfirmStatus, result) when(noConfirm, noconfirmStatus = axlGetVariable("NOCONFIRM"), axlSetVariable("NOCONFIRM", t)) when(forceNew && isFile(design), deleteFile(design)) result = if(noMru && axlVersion('version) >= 16.0 then axlOpenDesign(?design design, ?mode mode, ?noMru t) else axlOpenDesign(?design design, ?mode mode) ) when(noConfirm, if(noconfirmStatus then axlSetVariable("NOCONFIRM", t) else axlUnsetVariable("NOCONFIRM"))) result))
In reply to eDave:
Thanks for the tip, I'll try it out.
This seems to work fine, a small correction
you need to run axlSaveDesign before AFn_OpenDesign in the end to save of the symbol
I was wondering if you have a method to write the symbol file also, I can only get it to save the .dra file
In reply to Ejlersen:
axlSaveDesign should also create the compile the symbol if you are in the drawing editor.
Thats weird, since the code does contain "axlSaveDesign(?noMru t)" so that should be fine, but only the .dra file is saved, no ssm.
Maybe its because I only run the defun and not the complete skill program?
hi Dave and Ejlersen,
Did you solve your problem?
Because I want to create file.osm associated to my .dra file. And axlSaveDesign does only create my .dra file.
Have you got any solution for that? Thanks
In reply to djhutchi:
Thanks a lot, it works.
Just an information: You have to do that after axlSaveDesign of your file.dra
Otherwise it does not compile the symbol.osm