TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: andrew_nao on May 03, 2013, 10:12:09 AM
-
this code works in 2012, for some reason its not working in 2014
it inserts a tball with "1" and then for every time the lisp runs it inserts a new tball and automatically bumps the number up (2, 3, etc)
it keeps prompting me for input and it shouldnt
does anyone see anything wrong or know what is different in 2014 that would make this prompt me?
(defun c:tball ()
(setq ds (getvar "dimscale"))
(vl-load-com)
(setq lm (vlax-ldata-get "leadnum" "currentnum"))
(if (not lm)
(setq lm (vlax-ldata-put "leadnum" "currentnum" 1))
)
(vl-cmdf "insert" "tball" pause ds ds "" (itoa lm))
(vlax-ldata-put "leadnum" "currentnum" (1+ lm))
)
-
the issue is this
vl-cmdf, anyone know why this doesnt work in 2014?
that whole line doesnt work. tball is a block with and attribute and it doesnt like it..
-
Try this untested code:
(defun c:tball
( / at bn cm lm
) (setq bn
"tball") ;; Block Name
)
)
)
)
(princ "\nBlock not found.") )
)
-
thanks for the reply Lee,
but this still prompts me for the value
-
@andrew_nao:
Have you checked if the insert command has changed in AC2014? I suspect the attribute value may be used as the rotation angle when you use your code in AC2014.
-
@andrew_nao:
Have you checked if the insert command has changed in AC2014? I suspect the attribute value may be used as the rotation angle when you use your code in AC2014.
the insert command still works the same way as far as i can tell when doing it manually
the "" would be the rotation angle... im still plugging away at this though, however with no success as to why this works in 2012 & 2013 and not 2014
-
What is printed to the command-line if you set CMDECHO to 1 in my code?
-
What is printed to the command-line if you set CMDECHO to 1 in my code?
Command: TBALL
_.-insert Enter block name or [?] <A$C2DA246EE>: F:\acad\blocks\tball.dwg Substituting [SANSSB__.TTF] for [sasb____.pfb].
Units: Unitless Conversion: 1.00000000
Specify insertion point or [Basepoint/Scale/X/Y/Z/Rotate]: _S Specify scale factor for XYZ axes <1>: 12.00000000000000 Specify insertion point or [Basepoint/Scale/X/Y/Z/Rotate]: _R
Specify rotation angle <0d0'0.00">: 0.000000000000000 Specify insertion point or [Basepoint/Scale/X/Y/Z/Rotate]:
Command: 1 Unknown command "1". Press F1 for help.
-
see attreq value...
-
see attreq value...
thanks for the reply
that doesnt work for me either.
on 2012 its set to 1
when set to 0 the tball comes in with an X instead of a value.
this is mind boggling
-
what is the variable to turn off the dialog box prompt when inserting a block with attributes?
i think this is my issue but for the life of me cant remember that variable
edit: attdia needed to be set to 0 not 1
thanks for the replies everyone :)
-
Yes, they changed the default value of ATTDIA to 1, which broke most of my LISP routines, so I have added a setvar to my startup routines that always sets it back to 0 and it fixed all of this.
-
Yes, they changed the default value of ATTDIA to 1, which broke most of my LISP routines, so I have added a setvar to my startup routines that always sets it back to 0 and it fixed all of this.
Changing the default value of ATTDIA isn't the sabotage.
The sabotage, was very deliberately not bothering to detect when input is coming from some form of scripting (LISP, menu macro, .SCR, etc), and always using the command line in that case.
Yes it is sabotage, because it is a simple matter to detect when the input comes from scripting, and in fact, many commands already do that and automatically use the command line.