乐筑天下

搜索
欢迎各位开发者和用户入驻本平台 尊重版权,从我做起,拒绝盗版,拒绝倒卖 签到、发布资源、邀请好友注册,可以获得银币 请注意保管好自己的密码,避免账户资金被盗
楼主: Stryder

[编程交流] Lisp文件请求

[复制链接]

2

主题

18

帖子

16

银币

初来乍到

Rank: 1

铜币
10
发表于 2022-7-6 12:59:21 | 显示全部楼层
很好的快速响应!!!首先非常感谢您的帮助!!!
 
好的,我同意选择线并添加“x”距离是最好的方法。所以,这对我来说很好。
 
我不熟悉设置textsize变量的内容。每次用于此标注的文字高度为0.1*Dimscale。在95%的时间里,我的dimscale是50,所以高度将是5。
 
谢谢
斯特莱德
回复

使用道具 举报

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-6 13:03:48 | 显示全部楼层
好的,这处理了你大部分的原始请求,如果你还需要修改什么,请告诉我
 
[code](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)(
回复

使用道具 举报

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-6 13:06:02 | 显示全部楼层
^^^代码更新为包含Dimscale textsize
回复

使用道具 举报

2

主题

18

帖子

16

银币

初来乍到

Rank: 1

铜币
10
发表于 2022-7-6 13:07:26 | 显示全部楼层
该死,你跑得真快!!!!
 
好的,我仍然得到线的总长度,而不是只有“x”距离,斜率(如果可以的话)需要在小数点之前有一个零,小数点在左边的一个以上,所以乘以10??或者我可以在收到文本后手动更新。没问题,这已经大大加快了我的进程!!!
 
对不起,我是如此的痛苦!!!你是最棒的!!!
回复

使用道具 举报

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-6 13:10:27 | 显示全部楼层
 
 
啊,我的误解很抱歉,我会马上解决的。
 
 
不,你不是一个痛苦的人-至少你是感激的
 
谢谢
 
回复

使用道具 举报

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-6 13:16:20 | 显示全部楼层
好的,我修改了一些内容:
 
[列表]
  • 由于图形中DIMZIN变量的设置(设置为12),斜率测量之前的零被抑制,我在LISP中对此进行了修改,以克服此设置,但在LISP完成后将其恢复。
  • 我修改了斜率,使其小于10.0,但这不是图纸中绘制的测量斜率的值-只是想让您知道这一点。
    [/列表]
    [code](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)(
  • 回复

    使用道具 举报

    114

    主题

    1万

    帖子

    1万

    银币

    中流砥柱

    Rank: 25

    铜币
    543
    发表于 2022-7-6 13:18:39 | 显示全部楼层
    实际上,这更好:
     
    我还修改了一些内容:
     
    [列表]
  • 如果delta x为0,则斜率将只是一个破折号。(表示无限斜率)。
  • 文字将以正确的方式向上显示,适用于线条的每个角度。
    [/列表]
    [code](定义c:pipetxt(/*error*vlst ovar scl diam manhol lEnt lObj lLen lSpt lEpt lAng lMid)(vl load com)(定义e)
  • 回复

    使用道具 举报

    2

    主题

    18

    帖子

    16

    银币

    初来乍到

    Rank: 1

    铜币
    10
    发表于 2022-7-6 13:22:04 | 显示全部楼层
    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
    回复

    使用道具 举报

    114

    主题

    1万

    帖子

    1万

    银币

    中流砥柱

    Rank: 25

    铜币
    543
    发表于 2022-7-6 13:24:00 | 显示全部楼层
     
    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
    回复

    使用道具 举报

    2

    主题

    18

    帖子

    16

    银币

    初来乍到

    Rank: 1

    铜币
    10
    发表于 2022-7-6 13:26:39 | 显示全部楼层
    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?
    回复

    使用道具 举报

    发表回复

    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    • 微信公众平台

    • 扫描访问手机版

    • 点击图片下载手机App

    QQ|关于我们|小黑屋|乐筑天下 繁体中文

    GMT+8, 2025-3-5 06:20 , Processed in 0.571025 second(s), 70 queries .

    © 2020-2025 乐筑天下

    联系客服 关注微信 帮助中心 下载APP 返回顶部 返回列表