无论3dpoly等。。
可以通过以下方式查询UCS坐标:
getpoint函数
- (defun c:test (/ p z str )
- (while [color="green"];loop[/color]
- (setq [b]p[/b] ([color="blue"][b]getpoint[/b][/color] "\nSpecify point..")) [color="green"]; returns x y z list[/color]
- (setq z (caddr p)) [color="green"]; 3rd element in list , z[/color]
- (setq [b]str[/b] (strcat "Z= "(rtos z 2)))[color="green"]; convert to string[/color]
- (terpri)[color="green"]; next line[/color]
- [color="red"]
- ;to place text just complete your code here, where [color="black"][b]p[/b][/color]=insertion point , [b][color="black"]str[/color][/b]=contents
- ;using ([color="blue"]command[/color] "TEXT" [b]....[/b] ) ; ...mimic the step in commandline
- ;or ([url="http://www.cadtutor.net/forum/showthread.php?44768-Entmake-Functions"][b]entmake [/b][/url](list '(0 . "TEXT") [b]....[/b] )) ; dxf index 0 1 40 10 etc..
- [/color]
- )
- (princ)[color="green"] ;suppress[/color]
- )
对于3dpoly,可能需要将对象捕捉模式设置为“结束”和“最近”
(设置变量osmode(+1 512)) |