trefan123 Posted September 27, 2018 Posted September 27, 2018 (edited) Good day all, When loading a drawing it does not accept the "command" line eg (command "insert" "isolayer" nil) it accepts the setvars as per the code below I have copied modified the lisp to suit. Once the drawing is open it will accept the commands in lisp All blocks for insert are in the path Can i do this mix and match? Thx in advance (defun c:zz (/ cd vgad vgao vgd) (vl-load-com) (setq vgao (vlax-get-acad-object)) (setq vgad (vla-get-activedocument vgao)) (setq vgd (vla-get-documents vgao)) (setq fname (getfiled "" "D:\\AA-Programs\\A-PipingISO\\Borders" "dwg" 16)) (if (= 0 (getvar "SDI")) (vla-activate (vla-open vgd fname)) ; if sdi = 0 (vla-sendcommand vgad (strcat "(command \"_open\")\n" fname "\n")); if sdi = 1 ) ; if (setvar "cmdecho" 1) (setvar "blipmode" 0) (setvar 'osmode 53) ;(command "insert" "isolayer" nil) ;(command "insert" "dimstyle" nil) ;(command "ltscale" "0.2") ;(command "textsize" "2.5") ;(command "snapstyl" "1") ;(command "grid" "off") ;(command "ORTHO" "ON") ;(command "zoom" "e") (princ) ) Edited September 28, 2018 by trefan123 Clearer Quote
dlanorh Posted September 27, 2018 Posted September 27, 2018 (edited) Try this : (vla-sendcommand vgad (strcat "_open " fname " ")); if sdi = 1 You're trying to send a new line "\n". This is not an "enter". A space or "" is the equivalent of "enter" I'm still not sure this will work. Edited September 27, 2018 by dlanorh Quote
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.