Starting in December, we will archive content from the community that is 10 years and older. This FAQ provides more information.
Hi
I have this LISP which I'm using for sequential numbering and it runs perfectly ok in AutoCAD Architecture 2016 English ... The problem is when I run it on a different language pack of AutoCAD Architecture 2016 (German and French) ... any ideas how to fix this and get it to run on other LP of ACAD
File attached
PS: Previously posted this on ACA Forum and it was recommended to post question here 🙂
(defun C:arn () (setq a (getstring T " Enter prefix if any - "))(terpri) (setq b (getreal " Starting at number - "))(terpri) (setq h(getvar "textsize")) (setq c "W") (while c (setq c (getpoint "position of number -"))(terpri) (setq d (rtos b 2 0 )) (setq st (strcat a d )) (command "_text" "_m" c h "" st ) (setq b (+ b 1)) ) )
Solved! Go to Solution.
Solved by ВeekeeCZ. Go to Solution.
Solved by ВeekeeCZ. Go to Solution.
What if placing a dot at front of _text? ( i.e. (command "._text" ...
HTH
Same ... with or without dot the German and French LP seem to be Messing up with the translation
Can you tell if there is any error message?
Would this help?
it adds a Rotation angle 2 degrees instead of getting Default
then assumes text as a command (unknown Command/Befehl)
Hello
Welcome to the Autodesk / AutoCAD Forums
1) Your routine "ARN" is OK on a French ACAD !
2) Please check (before running) that your current text style has a Height = ZERO
3) Because the routine FAILS if there is a fixed (NON-ZERO) height !
Regards, Patrice
Patrice BRAUD
@JasonLLINDNER wrote:
...any ideas how to fix this and get it to run on other LP of ACAD
Any error message? or it just doesn't do anything?
EDIT: Too late
I am changing the routines for each LP that was just the one I am using in German... Issue starts with the Drehwink/Angle. Confused cuz it runs perfectly on English (testing in a new blank Default template drawing with all values reseted)
Just the screenshot i pasted above...nothing gets added to the drawing
I think @braudpat is right. This this code that should fix this.
(defun C:arn ( / a b h c st ) (setq a (getstring T "\nEnter prefix <none>: ") b (cond ((getreal "\nStarting at number <1>: ")) (1)) h (getvar 'TEXTSIZE)) (while (setq c (getpoint "\nPosition of number <done>: ")) (setq st (strcat a (rtos b 2 0 )) b (1+ b)) (command "_.TEXT" "_M" c) (if (= 0 (cdr (assoc 40 (tblsearch "STYLE" (getvar 'TEXTSTYLE))))) (command h)) (command "" st)) (princ) )
Edited. Last at :55.
@ВeekeeCZ wrote:
I think @braudpat is right. This this code that should fix this.
....
(command "_.TEXT" "_M" c) (if (= 0 (cdr (assoc 40 (tblsearch "STYLE" (getvar 'TEXTSTYLE))))) (command h)) (command "" st))
...
Same here, text style issues.
While you're at it, do away with command and use ENTMAKEX to completely avoid issues with the different language packs.
pbejse wrote:Same here, text style issues.
While you're at it, do away with command and use ENTMAKEX to completely avoid issues with the different language packs.
Sure, it's definitely way to improve the code, little more advanced but independent of the autocad version...
Some other improvements added as well.. you to learn from 🙂
(defun c:ARN ( / tmp) (or *arn-a* (setq *arn-a* "")) (or *arn-b* (setq *arn-b* 1)) (setq tmp (getstring T (strcat "\nEnter prefix <" (if (= *arn-a* "") "none" *arn-a*) ">: ")) *arn-a* (if (= tmp "") *arn-a* tmp) *arn-b* (cond ((getint (strcat "\nStart number <" (itoa *arn-b*) ">: "))) (*arn-b*))) (while (setq c (getpoint (strcat "\nPlace text '" (strcat *arn-a* (itoa *arn-b*)) "' <done>: "))) (entmake (list (cons 00 "TEXT") (cons 10 (trans c 1 0)) (cons 11 (trans c 1 0)) ; must be same as 10, would adjusted automatically (cons 40 (getvar 'TEXTSIZE)) (cons 50 (angle '(0 0 0) (getvar 'UCSXDIR))) (cons 01 (strcat *arn-a* (itoa *arn-b*))) (cons 72 4) (cons 73 0) )) (setq *arn-b* (1+ *arn-b*))) (princ) )
Can't find what you're looking for? Ask the community or share your knowledge.