I would like to build a custom button that mimics the FDO - Save as AutoCAD drawing functionality. Clicking this button brings up a wizard with too many clicks for how often the users will do it.
They will not want to load a script so a custom button is required. Also, I need to be able to dynamically set the new saved file name based on the source DWG file name.
What documentation should I be reviewing to get started with this? thanks.
(vl-load-com) (defun c:whatever(/ dwgnm dwgfld nmandfld) (setvar "FILEDIA" 0) (setq dwgnm (substr (getvar "DWGNAME") 1 (- (strlen (getvar "DWGNAME")) 4))) (setq dwgfld (getvar "dwgprefix")) (setq nmandfld (strcat dwgfld dwgnm "_FDO.dwg")) (alert nmandfld) (vl-cmdf "MAPEXPORTCURRENTMAPTODWG" nmandfld) (setvar "FILEDIA" 1) (princ) )
This code will export the current map as a dwg of the same name as the current drawing, but with "_FDO" appended. It saves the new drawing to the same folder as the current drawing. You might want to remove the alert. I put it there so the user will be told what file is being saved, but it's not critical. And, of course, you will want to change my c:whatever nomenclature to a name that makes sense to you.
Is this what you were looking to do? If you don't know how to put this on a button, read up on the CUI, including how to create a new command and how to add a command to a ribbon panel.