Jump to content

Recommended Posts

Posted (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 by trefan123
Clearer
Posted (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 by dlanorh

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...