好的,我同意选择线并添加“x”距离是最好的方法。所以,这对我来说很好。
我不熟悉设置textsize变量的内容。每次用于此标注的文字高度为0.1*Dimscale。在95%的时间里,我的dimscale是50,所以高度将是5。
谢谢
斯特莱德 好的,这处理了你大部分的原始请求,如果你还需要修改什么,请告诉我
(defun c:pipetxt(/*error*vlst ovar scl diam manhol lEnt lObj lLen lSpt lEpt lAng lMid)(vl load com)(defun*error*(msg)(if ovar(mapcar'setvar vlst ovar))(if(not(member msg'(“Function cancelled”“quit/exit abort”))(princ(strcat”\n错误:“(strcase msg))(princ“))(princ))(setq vlst'(“OSMODE”“CLAYER”)ovar(mapcar'getvar vlst))(setvar“OSMODE”0)(或(tblsearch“LAYER”“TXT-100”)(vla add(vla get layers(vla get ActiveDocument(vlax get acad object))“TXT-100”)(或(and(zerop(getvar“DIMSCALE”))(setq scl(getvar“DIMSCALE”))(或pip:dia(setq pip:dia)(或man:hol(setq man:hol 10.96))(initget 6)(setq diam(getreal(strcat“\n验证管道vla对象lEnt的直径(+(vla get length lObj)man:hol)lSpt(vlax curve getStartPoint lObj)lEpt(vlax curve getEndPoint lObj)lAng(angle lSpt lEpt)lSlp(/((cadr lEpt)(cadr lSpt))((car lEpt)(car lSpt)))lMid(vlax curve getPointatParam lObj(/(vlax curve getEndParam lObj)2.0))(if(and(>lAng 0)( ^^^代码更新为包含Dimscale textsize 该死,你跑得真快!!!!
好的,我仍然得到线的总长度,而不是只有“x”距离,斜率(如果可以的话)需要在小数点之前有一个零,小数点在左边的一个以上,所以乘以10??或者我可以在收到文本后手动更新。没问题,这已经大大加快了我的进程!!!
对不起,我是如此的痛苦!!!你是最棒的!!!
啊,我的误解很抱歉,我会马上解决的。
不,你不是一个痛苦的人-至少你是感激的
谢谢
李 好的,我修改了一些内容:
[列表]
[*]由于图形中DIMZIN变量的设置(设置为12),斜率测量之前的零被抑制,我在LISP中对此进行了修改,以克服此设置,但在LISP完成后将其恢复。
[*]我修改了斜率,使其小于10.0,但这不是图纸中绘制的测量斜率的值-只是想让您知道这一点。
[/列表]
(defun c:pipetxt(/*error*vlst ovar scl diam manhol lEnt lObj lLen lSpt lEpt lAng lMid)(vl load com)(defun*error*(msg)(if ovar(mapcar'setvar vlst ovar))(if(not(member msg'(“Function cancelled”“quit/exit abort”))(princ(strcat”\n错误:“(strcase msg))(princ“))(princ))(setq vlst'(“CLAYER”“OSMODE”“DIMZIN”)ovar(mapcar'getvar vlst))(mapcar“setvar(cdr vlst)”(0 1))(或(tblsearch“LAYER”“TXT-100”)(vla add(vla get layers(vla get ActiveDocument(vlax get acad object))“TXT-100”)(或(and(zerop(getvar“DIMSCALE”))(setq scl(getvar“DIMSCALE”)))(或pip:dia(setq pip:dia)(或man:hol(setq man:hol 10.96))(initget 6)(setq diam(getreal(strcat))“\n缩小管道vla对象lEnt)lSpt(vlax curve getStartPoint lObj)lEpt(vlax curve getEndPoint lObj)lAng(angle lSpt lEpt)lSlp(/((cadr lEpt)(cadr lSpt))((car lEpt)(car lSpt)))lLen(+(abs(-car lEpt)(car lSpt)))man:hol)lMid(vlax curve getPointatParam lObj(/(vlax curve getEndParam lObj)2.0))(if(and(>lAng 0)( 实际上,这更好:
我还修改了一些内容:
[列表]
[*]如果delta x为0,则斜率将只是一个破折号。(表示无限斜率)。
[*]文字将以正确的方式向上显示,适用于线条的每个角度。
[/列表]
(定义c:pipetxt(/*error*vlst ovar scl diam manhol lEnt lObj lLen lSpt lEpt lAng lMid)(vl load com)(定义e) WOW!!! Thank you very much!!! And I really appreciate the additional info about the last few things you modified. This is AWESOME!!! I may have some more projects in the future, if you are interested. I really wish we lived closer so you could teach me how to write lisp files!
Thanks,
Stryder
No Problem at all - happy to help you out
If you need anything in the future, just ask.
LISP really does make the process much faster - so learning the code is a real benefit - there are tons of tutorial sites out there, just search the threads on here, or google such names as: AfraLISP, JefferySanders, RonLeigh... etc
Cheers
Lee Well, after using this lisp for a while, I love it!! However, the guys that I work with and I have been discussing just a few minor changes. We would like to have mtext instead of dtext, the bottom center is still good on the justification but we will need to give an offset value from the line. This is because mtext bottom center is different than dtext bottom center, the mtext bc will put the text right on the line. We would also like to be able to adjust the distance before placing the text, like you did with the pipe dia and the mh dia. Give it a default of something that looks good but then allow us to change it if we need to. The reason for the mtext is because sometimes the distance between the manholes is so close that we want to be able to adjust the width of the text. We were doing this by converting the dtext to mtext but then it adjusted the position and we had to move it back... and we are lazy!!!
So, is this possible?
页:
1
[2]