BlackAlnet Posted November 13, 2009 Posted November 13, 2009 What's wrong whit this? (defun c:asd (/ ent obj x y y2 pos) (vl-load-com) (if (setq ent( entsel "\nSelecione: ")) (progn (setq obj (vlax-ename->vla-object (car ent))) (setq cord (cdr ent)) (setq x (car cord)) (setq y (cdr cord)) (setq y2 (= y -1)) (setq pos (vla-get-alignment obj)) (vla-put-backward obj 1) (vla-put-upsidedown obj 1) ) ) (if ( = pos 2) (vla-put-alignment obj 12) ) (if ( = pos 0) (vla-put-alignment obj 14) ) (vla-put-insertionpoint obj list(x y2 0)) ) i can't change the insertionpoint of the text. I'm very glad for any help or improviment on this code. Thanks! Quote
fixo Posted November 13, 2009 Posted November 13, 2009 What's wrong whit this? (defun c:asd (/ ent obj x y y2 pos) (vl-load-com) (if (setq ent( entsel "\nSelecione: ")) (progn (setq obj (vlax-ename->vla-object (car ent))) (setq cord (cdr ent)) (setq x (car cord)) (setq y (cdr cord)) (setq y2 (= y -1)) (setq pos (vla-get-alignment obj)) (vla-put-backward obj 1) (vla-put-upsidedown obj 1) ) ) (if ( = pos 2) (vla-put-alignment obj 12) ) (if ( = pos 0) (vla-put-alignment obj 14) ) (vla-put-insertionpoint obj list(x y2 0)) ) i can't change the insertionpoint of the text. I'm very glad for any help or improviment on this code. Thanks! Take a look at TextAlignmentPoint property in the Help file ~'J'~ Quote
BlackAlnet Posted November 13, 2009 Author Posted November 13, 2009 I read, but i can't fix that part, it's continues returning "; error: bad function: (800194.0 469602.0 0.0)" Quote
alanjt Posted November 13, 2009 Posted November 13, 2009 Replace with this line: (vla-put-insertionpoint obj (vlax-3D-point (list x y2 0))) You had your list defined incorrectly. You have to convert the list to a variant. Quote
BlackAlnet Posted November 13, 2009 Author Posted November 13, 2009 Replace with this line: (vla-put-insertionpoint obj (vlax-3D-point (list x y2 0))) You had your list defined incorrectly. You have to convert the list to a variant. alanjt, i have tryed this, and it wont work... continues returning "error: bad argument type: numberp: (800059.0 469502.0 0.0)" I don't know what's happening Quote
fixo Posted November 13, 2009 Posted November 13, 2009 I read, but i can't fix that part, it's continues returning "; error: bad function: (800194.0 469602.0 0.0)" There are a lot of another basic mistakes here: See how it will be works (tested slightly) (defun c:asd (/ ent obj x y y2 pos) (vl-load-com) (if (setq ent( entsel "\nSelecione: ")) (progn (setq obj (vlax-ename->vla-object (car ent))) (setq cord (cadr ent));; was (cdr ent) (setq x (car cord)) (setq y (cadr cord));; was (cdr cord) (setq y2 (- y 1)) ; was (= y -1); bad syntax (setq pos (vla-get-alignment obj)) (vla-put-backward obj 1) (vla-put-upsidedown obj 1) ) ) (cond (( = pos 0) (progn (vla-put-insertionpoint obj (vlax-3d-point (list x y2 0)));was (vla-put-insertionpoint obj list(x y2 0)) (vla-put-alignment obj 12) (vla-put-textalignmentpoint obj (vlax-3d-point (list x y2 0)));;added ) ) (( = pos 2) (progn (vla-put-insertionpoint obj (vlax-3d-point (list x y2 0)));was (vla-put-insertionpoint obj list(x y2 0)) (vla-put-alignment obj 14) (vla-put-textalignmentpoint obj (vlax-3d-point (list x y2 0)));;added ) ) ()) (princ) ) ~'J'~ Quote
BlackAlnet Posted November 13, 2009 Author Posted November 13, 2009 Understood, many thanks!! I don't realize i need to change boot alingn and insertion point. Many thanks fixo. Quote
fixo Posted November 13, 2009 Posted November 13, 2009 Understood, many thanks!! I don't realize i need to change boot alingn and insertion point. Many thanks fixo. You're welcome, Cheers ~'J'~ 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.