? 带云的维度
有人能创建一个维度lisp吗代替数值尺寸,仅显示“?”
同时在其周围放置了一个rev云
我看到,在创建新的dimstyle时,可以在其周围绘制一个框架。不知道是否可以自动将其更改为云?我还需要能够更改dimstyle,因为当我们对不同类型的区域进行云计算时,它们可能需要位于不同的层上。如果没有给出尺寸,我必须将每个尺寸都更改为“D.E.”或“E.O.S.”,这可能会变得很乏味
我到处找过这样的东西,但什么也没找到。我们一如既往地感谢大师的任何帮助。
谢谢
诺布尔 试着看看这是否是你搜索的。。。
(defun c:d? ( / *error* DTR GetMTextBB ogt ch d mt pts p1 p2 p3 p4 pl )
(defun *error* ( msg )
(if ogt (setvar 'offsetgaptype ogt))
(if msg (prompt msg))
(princ)
)
(defun DTR ( a )
(* (/ a 180.0) pi)
)
(defun GetMTextBB ( Ent / EntData EnsPt TxtJust TxtWd TxtHt TxtRot LeftX RightX TopY BottomY )
;;; Source : https://groups.google.com/forum/#!topic/autodesk.autocad.customization/gGZBLTD3Qls
;;; Get real Bounding Box for MText
;;; Tim Willey 03/2005
;;; Improved for any angle Text by mailmaverick 12-12-2013
;;; Thanks to OLD-CADaver for the tips on the DXF codes
;;; Points p1, p2, p3 and p4 are explained below :
;;; If the MTEXT gets rotated, the points remain the same.
;|
;
p3 p2
------------------------
| |
| |
| |
| |
| |
| |
------------------------
p1 p4
;
|;
(setq EntData (entget Ent))
(setq InsPt (acet-dxf 10 EntData))
(setq TxtJust (acet-dxf 71 EntData))
(setq TxtRot (acet-dxf 50 EntData))
(setq TxtWd (acet-dxf 42 EntData))
(setq TxtHt (acet-dxf 43 EntData))
(cond
((= TxtJust 1)
(setq p3 InsPt)
(setq p1 (polar p3 (+ (DTR 270) TxtRot) TxtHt))
(setq p2 (polar p3 TxtRot TxtWd))
(setq p4 (polar p1 TxtRot TxtWd))
)
((= TxtJust 2)
(setq p3 (polar Inspt (+ (DTR 180) TxtRot) (/ TxtWd 2)))
(setq p1 (polar p3 (+ (DTR 270) TxtRot) TxtHt))
(setq p2 (polar p3 TxtRot TxtWd))
(setq p4 (polar p1 TxtRot TxtWd))
)
((= TxtJust 3)
(setq p2 Inspt)
(setq p3 (polar p2 (+ (DTR 180) TxtRot) TxtWd))
(setq p1 (polar p3 (+ (DTR 270) TxtRot) TxtHt))
(setq p4 (polar p1 TxtRot TxtWd))
)
((= TxtJust 4)
(setq p3 (polar Inspt (+ (DTR 90) TxtRot) (/ TxtHt 2)))
(setq p1 (polar p3 (+ (DTR 270) TxtRot) TxtHt))
(setq p2 (polar p3 TxtRot TxtWd))
(setq p4 (polar p1 TxtRot TxtWd))
)
((= TxtJust 5)
(setq temp (polar Inspt (+ (DTR 90) TxtRot) (/ TxtHt 2)))
(setq p3 (polar temp (+ (DTR 180) TxtRot) (/ TxtWd 2)))
(setq p1 (polar p3 (+ (DTR 270) TxtRot) TxtHt))
(setq p2 (polar p3 TxtRot TxtWd))
(setq p4 (polar p1 TxtRot TxtWd))
)
((= TxtJust 6)
(setq p2 (polar Inspt (+ (DTR 90) TxtRot) (/ TxtHt 2)))
(setq p3 (polar p2 (+ (DTR 180) TxtRot) TxtWd))
(setq p1 (polar p3 (+ (DTR 270) TxtRot) TxtHt))
(setq p4 (polar p1 TxtRot TxtWd))
)
((= TxtJust 7)
(setq p1 Inspt)
(setq p3 (polar p1 (+ (DTR 90) TxtRot) TxtHt))
(setq p2 (polar p3 TxtRot TxtWd))
(setq p4 (polar p1 TxtRot TxtWd))
)
((= TxtJust
(setq p1 (polar Inspt (+ (DTR 180) TxtRot) (/ TxtWd 2)))
(setq p3 (polar p1 (+ (DTR 90) TxtRot) TxtHt))
(setq p2 (polar p3 TxtRot TxtWd))
(setq p4 (polar p1 TxtRot TxtWd))
)
((= TxtJust 9)
(setq p4 Inspt)
(setq p2 (polar p4 (+ (DTR 90) TxtRot) TxtHt))
(setq p3 (polar p2 (+ (DTR 180) TxtRot) TxtWd))
(setq p1 (polar p3 (+ (DTR 270) TxtRot) TxtHt))
)
)
(list p1 p2 p3 p4)
)
(setq ogt (getvar 'offsetgaptype))
(setvar 'offsetgaptype 0)
(if (not (tblsearch "LAYER" "dim_revcloud"))
(entmake '((0 . "LAYER") (100 . "AcDbSymbolTableRecord") (100 . "AcDbLayerTableRecord") (2 . "dim_revcloud") (70 . 0) (62 . 6) (6 . "Continuous")))
(prompt "\nLayer : \"dim_revcloud\" already exist - setting it to current and proceeding with routine...")
)
(setvar 'clayer "dim_revcloud")
(initget "1 2")
(setq ch (getkword "\nChoose text of dimension <?>: "))
(cond
( (eq ch nil)
(prompt "\nPick start and end point of linear dimension...")
(command "_.dimaligned" "\\" "\\" "t" "?")
(while (> (getvar 'cmdactive) 0) (command "\\"))
)
( (eq ch "1")
(prompt "\nPick start and end point of linear dimension...")
(command "_.dimaligned" "\\" "\\" "t" "? D.E.")
(while (> (getvar 'cmdactive) 0) (command "\\"))
)
( (eq ch "2")
(prompt "\nPick start and end point of linear dimension...")
(command "_.dimaligned" "\\" "\\" "t" "? E.O.S.")
(while (> (getvar 'cmdactive) 0) (command "\\"))
)
)
(setq d (entlast))
(setq mt (car (nentselp (mapcar '/ (mapcar '+ (acet-dxf 10 (entget d)) (acet-dxf 11 (entget d))) '(2.0 2.0 2.0)))))
(if (not (eq (acet-dxf 0 (entget mt)) "MTEXT"))
(while (not (eq (acet-dxf 0 (entget (setq mt (entnext mt)))) "MTEXT")))
)
(setq pts (GetMTextBB mt))
(setq p1 (car pts) p2 (cadr pts) p3 (caddr pts) p4 (cadddr pts))
(command "_.pline" p1 p4 p2 p3 "c")
(setq pl (entlast))
(command "_.offset" "t" pl (mapcar '+ p2 (mapcar '- p2 p1)) "")
(command "_.revcloud" "s" "n" "o" (entlast) "")
(entdel pl)
(*error* nil)
(princ)
)
HTH,M.R。 这基本上就是我想要的。是否可以在文本周围自动添加revcloud?我也需要能够改变层,但我这里有一个人谁应该能够做到这一点,如果我不能。谢谢你的命令。我认为这已经是一个帮助,因为它是,但云会使它变成金色。
再次感谢,
诺布尔 我算出了层次。但revcloud函数的行为似乎有些奇怪。它不会在周围形成云,而是更多地穿过它。我能选择书法风格吗(因为这是我们在其他方面使用的风格)。对不起,我绝对是Lisp程序的新手。我计划留出一些时间来学习各种可用的教程。
-诺布尔 有没有人可以查看上面列出的代码?它接近我需要的,但只是一辆小马车。。。
-诺布尔 最近我没有太多时间做CADTutor,但我快速看了一下这个。当我运行它时,Revcloud根本没有出现,它应该是由什么组成的矩形也没有出现。
该例程似乎有一个偏移量,可以控制Revcloud的大小。也许你应该上传一张带着结果的图,让别人来评估。
至于你的图层问题,只需在这里将“dim\u revcloud”更改为你的名字。
或者,如果您的层不存在,则更改所有“dim\u revcloud”出现。 我已经解决了图层问题,但它是给我带来麻烦的云
附件是如何出来,如果你做一个尺寸超过一定的大小,这可能是另一个问题。如果使用的维度太小,则不会显示云。
它还只允许使用数字键盘而不是简单地点击回车键来确定后缀,即“D.e.”或“e.O.S.”。它不像现在这样对用户友好,但这些小问题确实是我最不担心的问题。需要做的主要事情是让云正确显示,并可能将云样式更改为书法。
任何帮助都将不胜感激。
-诺布尔 这很好,但实际上你应该发布解决方案,这样其他人也能从中受益。
您的其他信息在这里很有帮助。图像正常。通常,DWG要好得多。
查看REVCLOUD命令的所有选项,因为它实际上在例程中使用。请参见此行:
在有“n”的地方,如果你想要书法,你应该放“c”。就这么简单。弧长选项也可能有用。 好的,根据我之前的回复,你应该正在解决主要问题的路上。
我不清楚你在输入方面的问题。您建议如何设置它,以便只需按Enter键即可选择您想要的内容?好吧,只有当你总是选择默认值时,这才有效。Marko设置了3个选项,因为这就是你所指出的。你真的只有一个选择吗?在这种情况下,您甚至不需要按Enter键。只是把它硬编码到例程中。也许你有一个主要的选择,而其他的并不常见?然后,将其设置为默认值。如果您有其他想法,但不知道如何实现,请更清楚地说明,包括显示您想象的提示应该是什么样子。这是一种真正能帮助别人为你解决问题的方法。顺便问一下,你的D.E和E.O.S.代表什么?
页:
[1]