Message 1 of 5
Changing scale of all entities in multiple .dxfs
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Due to some software limitations, I've been given a large number of .dxf files that were drawn in mm that need to be scaled to inches before being sent to fabrication.
I've gotten as far as iterating through a list of files, and being able to open, save and close each one, however I'm having a stumbling block as to how to change the scale for all entities.
(defun ScaleFiles (files factor / acadApp acadDocs)
(setq acadApp (vlax-get-acad-object))
(setq acadDocs (vlax-get-property acadApp 'Documents))
(mapcar
'(lambda (fp / newDoc eMin eMax)
(setq newDoc (vlax-invoke acadDocs 'open fp))
;(command "_Scale" "_All" "" "0,0" factor) ;Doesn't work
(vlax-invoke newDoc 'close ':vlax-true)
);lambda
files
);mapcar
);defun
I've done a bit of digging and found that ObjectDBX has a few limitations:
- No Selection Sets (use of ssget, ssname, ssdel etc)
- No Command calls (command "_.line" ... etc)
- No ent* methods (entmod, entupd etc)
- No access to System Variables (getvar, setvar, vla-getvariable, vla-setvariable etc)
If the above is true, is it even possible to scale these drawings like this? or would I need to use an alternative solution (like script pro) instead?
Any suggestions would be appreciated.