rk25134 Posted April 23, 2015 Share Posted April 23, 2015 Please suggest how to change the code accordingly (VL-LOAD-COM) (defun C:D2D (/path dgnfile SDI_Mode) (setq path ((setq DirPath (acet-ui-pickdir)) (setq ref (vlax-get-acad-object)) (SETQ FILES (VLA-GET-FILES (VLA-GET-PREFERENCES ref))) (SETQ OLDSUPPORT (VLA-GET-SUPPORTPATH FILES)) (SETQ NEWPATH (STRCAT OLDSUPPORT ";" DirPath ";")) (VLA-PUT-SUPPORTPATH FILES NEWPATH));;Default path for DGN files location. DGNIMPORTMODE 0 ;;Imports the DGN file in a new drawing file. SDI_Mode SDI ;;Save Current SDI MODE SDI 1 ;;SET Single Drawing Mode for AutoCAD. ) (setq files (vl-directory-files path "*.dgn")) (foreach dgnfile files (command "-dgnimport" (strcat path dgnfile) "" "" "" "y" (strcat path dgnfile ".dwg")) ) ) Quote Link to comment Share on other sites More sharing options...
BIGAL Posted April 23, 2015 Share Posted April 23, 2015 You have a few problems you need to use (setvar "variable name" value) and (setq Sdi_mode (getvar "sdimode")) Quote Link to comment Share on other sites More sharing options...
SLW210 Posted April 23, 2015 Share Posted April 23, 2015 Please read the Code Posting Guidelines and edit your post to include the Code in Code Tags. Quote Link to comment Share on other sites More sharing options...
BIGAL Posted April 24, 2015 Share Posted April 24, 2015 Adjusted but not tested (VL-LOAD-COM) (defun C:2D (/path dgnfile SDI_Mode) (setq path (setq DirPath (acet-ui-pickdir))) (setq ref (vlax-get-acad-object)) (SETQ FILES (VLA-GET-FILES (VLA-GET-PREFERENCES ref))) (SETQ OLDSUPPORT (VLA-GET-SUPPORTPATH FILES)) (SETQ NEWPATH (STRCAT OLDSUPPORT ";" DirPath ";")) (VLA-PUT-SUPPORTPATH FILES NEWPATH);;Default path for DGN files location. (setvar "DGNIMPORTMODE" 0) ;;Imports the DGN file in a new drawing file. (setq SDI (getvar "SDI_Mode")) ;;Save Current SDI MODE (setvar "SDI_mode" 1) ;;SET Single Drawing Mode for AutoCAD. (setq files (vl-directory-files path "*.dgn")) (foreach dgnfile files (command "-dgnimport" (strcat path dgnfile) "" "" "" "y" (strcat path dgnfile ".dwg")) ) ; foreach ) ; defun Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.