I have some problems with this code and was hoping someone could guide me in the right direction. If I run the first part of the code up to inserting the block I have the following to issues
1) after inserting the block the prompt to "Select insertion point" stays on the command line
2) Next to that it says Press enter to continue and when I do it returns with TITLE unknown command
Code:
(defun c:title ()
(vl-load-com)
(if(=(getvar "tilemode") 1)
(setvar "tilemode" 0)
)
(command "_Insert" "G:\\PE Standards\\CAD\\BLOCKS AND SYMBOLS\\BLOCKS AND TAGS\\SHEETNOTE.DWG" (getpoint "\nSelect insertion point") "" "" "" Pause)
)
3) However when I run the entire code I get misplaced dot on input.
Code:
(defun c:title2 ( / ent strfield objID)
(vl-load-com)
;;;check for model space and switch to paper space
(if(=(getvar "tilemode") 1)
(progn
(setvar "tilemode" 0)
)
)
(command "_Insert" "G:\\PE Standards\\CAD\\BLOCKS AND SYMBOLS\\BLOCKS AND TAGS\\SHEETNOTE.DWG" (getpoint "\nSelect insertion point") "" "" "" Pause)
;;; Select an object
(if(setq ent (entsel)
(progn
(setq ent (car ent))
:::Obtain object ID
(progn
(setq objID (vla-get-objectid (vlax-ename->vla-object ent)))
;;;Create field expression
(setq strfield
(strcat "%<\\AcObjProp Object(%<\\_ObjId "
(rtos objID 2 0)
>%).CustomScale \\f \"%lu4%pr8%ct2%qf2816 = 1'-0\"\">%
)
)
;;;Text for field
(command "_text" (getpoint) pause pause strfield)
)
)
)
(princ)
)