;\in original
(setq ins_txt pt_start );TEXT PCstart
(vla-addMtext Space
(vlax-3d-point (trans ins_txt 1 0))
0.0
(strcat
"{\\fARIAL|b0|i0|c0|p34;"
"PC" (itoa nb) "}" )
);TEXT PCend
;\ how to rotate the text in this fragment and move from source x = 0, y = 0 when inserting, and made that adaptation and gives error, someone is able to risk a guess
(setq ins_txt pt_start (polar (angle pt_start pt_cen)));TEXT PCstart
(vla-addMtext Space
(vlax-3d-point (trans ins_txt 1 0))
0.0
(strcat
"{\\fARIAL|b0|i0|c0|p34;"
"PC" (itoa nb) "}" )
);TEXT PCend
Your syntax for SETQ and POLAR is incorrect.
(setq ins_txt pt_start (polar (angle pt_start pt_cen)));TEXT PCstart
See link below for the correct use of POLAR.
Try 01
(setq ins_txt pt_start (polar (angle pt_start pt_cen)));TEXT PCstart (polar 'pt ang dist)
Try 02
(setq ins_txt pt_start (polar 'pt_start (angle pt_start pt_cen) 10 )) ;TEXT PCstart (polar 'pt ang dist)
ERRO : syntax error
Cannot invoke (command) from *error* without prior call to (*push-error-using-command*).
Converting (command) calls to (command-s) is recommended.
Try 03
(setq ins_txt pt_start (polar 'pt_start (pt_start pt_cen) 10 ));TEXT PCstart (polar 'pt ang dist)
ERRO : syntax error
Cannot invoke (command) from *error* without prior call to (*push-error-using-command*).
Converting (command) calls to (command-s) is recommended.
(setq ins_txt pt_start (polar (angle pt_start pt_cen)))
------- -------- -------------------------------
1 2 3
Should be something like:
(setq ins_txt pt_start)
(setq xyz (polar ......))
(setq xyz (polar (angle pt_start pt_cen)))
Should be something like:
(setq xyz (polar pt_start angle distance))
-------- ----- --------
| | |
point list | real
angle in rad
Try like this.......
............
(setq pt_start (getpoint "\npick point for pt_start: ")) (setq pt_cen (getpoint "\npick point pt_cen: ")) (setq ins_txt (polar pt_start (angle pt_start pt_cen) 10)) (setq acadObj (vlax-get-acad-object)) (setq doc (vla-get-ActiveDocument acadObj)) (setq Space (vla-get-ModelSpace doc)) (vla-addMtext Space (vlax-3d-point (trans ins_txt 1 0)) 0.0 (strcat "{\\fARIAL|b0|i0|c0|p34;" "PC" (itoa 7) "}"));Here "7" only for demo (vla-put-Rotation (vlax-ename->vla-object (entlast)) (angle pt_start pt_cen))
............
@dbhunia wrote:
Try like this.......
............
(setq pt_start (getpoint "\npick point for pt_start: ")) (setq pt_cen (getpoint "\npick point pt_cen: ")) (setq ins_txt (polar pt_start (angle pt_start pt_cen) 10)) (setq acadObj (vlax-get-acad-object)) (setq doc (vla-get-ActiveDocument acadObj)) (setq Space (vla-get-ModelSpace doc)) (vla-addMtext Space (vlax-3d-point (trans ins_txt 1 0)) 0.0 (strcat "{\\fARIAL|b0|i0|c0|p34;" "PC" (itoa 7) "}"));Here "7" only for demo (vla-put-Rotation (vlax-ename->vla-object (entlast)) (angle pt_start pt_cen))
............
Vla add methods return the object created. So you can avoid the (entlast) by using
(setq n_obj (vla-addMtext Space (vlax-3d-point (trans ins_txt 1 0)) 0.0 (strcat "{\\fARIAL|b0|i0|c0|p34;" "PC" (itoa 7) "}")));Here "7" only for demo (vla-put-Rotation n_obj (angle pt_start pt_cen))
I am not one of the robots you're looking for
Can't find what you're looking for? Ask the community or share your knowledge.