Bill Tillman 发表于 2022-7-6 08:16:43

Entmake AR-CONC Hatch为No-

我试图创建一个混凝土板的细节,所有这些都是由VLISP绘制的截面。我现在的困惑是这个entmake实用程序,李和我很久以前共享。我尝试了各种与列表中数字的组合,但到目前为止,AR-CONC图案填充我没有出现。没有错误消息或任何调试信息,代码只是悄悄退出,我只想知道出了什么问题。
 
我的代码绘制了一条多段线来表示楼板,然后我只想用比例为0.25的AR-CONC图案填充形状的内部。
 

(defun c:dummyhatch ()
(vl-load-com)

(setq slabdp 6)
(setq afrmdp 3)
(setq pt1 '(0.0 0.0))
(setq pt2 (polar (polar pt1 (dtr 0.0) slabdp) (dtr 90.0) 1.75))

(command "._PLINE" pt1 "@6.5<90"
               "@2<350" "@1.6875<339" "@1.625<325" pt2 "@1.75<270" (strcat "@" (rtos slabdp) "<180") "")

(entmake (list '(0 . "HATCH")
                '(100 . "AcDbEntity")
                '(8 . "0")
                '(62 . 2)
                '(100 . "AcDbHatch")
                '(10 0 0 0)
                '(210 0 0 1)
                '(2 . "AR-CONC")
                '(70 . 0)
                '(71 . 0)
                '(91 . 1)
                '(92 . 0)
                ;'(72 . 1)
                '(73 . 0)
                ;'(93 . 3)
                '(10 0 0 0)
                '(97 . 0)
                '(41 . 0.25)
                '(75 . 0)
                '(76 . 1)
                '(47 . 0.0334902)
                '(98 . 1)
                '(10 3.0 3.0 0.0)))

(princ)

); end function

(defun dtr (x)
(* pi (/ x 180.0))
); end function

Lee Mac 发表于 2022-7-6 08:24:34

对addhatch做了更多的挖掘,以前从未使用过它,所以其他人可能会反驳我,但基本上你选择一个图案填充,然后创建一条多段线,然后使用(vlax invoke hatch'AppendOuterLoop)图案填充是选择的图案,outerloop是pline。按照我的方式,您将首先使用Bpoly创建“outerloop”
 
它实际上是在帮助中,只是一个将所有这些放在一起的案例。快捷方式(命令“-hatch“pt1”)有效。

Stefan BMR 发表于 2022-7-6 08:29:05

抱歉劫持了帖子。
 
帮助bpoly TREAD(vlax invoke space'addbpoly Pt1))给出;错误:ActiveX服务器返回错误:未知名称:“ADDBPOLY”(命令“bpoly”pt1“)有效?我很确定需要使用boundary来创建Outerloop
 
我会继续找比尔

Bill Tillman 发表于 2022-7-6 08:33:16

比尔,这是vla AddHatch的样品,最低限度的测试。
但是,您必须计算图案填充轮廓的每个点,要么绘制成为图案填充边界的对象,要么像我上一篇文章中那样创建图案填充。
顺便说一句,嵌入的对象是块?如果是的话,vla方法帮不了什么忙。
要使用vla ADDHACH创建图案填充,选择集必须包含连接的对象,即端点必须重合。
 
command和vla AddHatch之间的差异只是速度问题;然而,对于一个或两个舱口来说,这并不是什么大问题。
我没有在测试函数中放置过滤器,因为您不会使用此方法来获取选择集。我认为ssadd更适合自动化。

Bill Tillman 发表于 2022-7-6 08:34:41

账单
 
我们以前没有走过这条路吗?
 
http://www.cadtutor.net/forum/showthread.php?65562-entmake与否entmake&p=448089&viewfull=1#post448089
 
你读了我链接到你的帖子了吗?

Lee Mac 发表于 2022-7-6 08:42:22

是的,但让我更深入地解释一下。我尽量不要把我的帖子塞得太多,因为这个项目比人们想象的要复杂得多。我正在处理的板段中有一个嵌入件,有时,只有有时,它也有一个焊接到嵌入件底部的板,该嵌入件向下延伸到板的深度。这意味着我需要保留这个区域, 1/4“沿着内部边缘清除。除此之外,用户可以从几个不同的板深度中选择任何一个。可能这像泥一样清晰,但事实就是这样。我通过两步操作解决了这个问题。我在这张图中使用的一些东西我没有找到其他方法来解决这个问题。对于这一个,我首先根据用户的ans为需要图案填充的区域绘制一条多段线我们回答Excel电子表格中的问题。然后我简单地选择这个区域作为图案填充目标,就完成了。然后删除多段线并将其重新绘制回正确的尺寸。这不是一个有效的过程,但最终我得到了所需要的,并且该例程将适用于任何一组变量。如果用户想要绘制6“板或6英尺厚的板,甚至600英里厚的板。代码有效,这就是这个项目的全部内容。要使用Excel文件中的任何输入。一旦用户单击Excel中的宏按钮,整个过程在AutoCAD中由这个VLISP文件控制。我想我现在有大约700行代码,包括注释,但该死的东西在工作,这不是。”一件坏事。
 
我很想使用AddHatch,但我没有发现任何东西表明它可以与点一起工作,只需在要填充的对象中选择一个点。

Bill Tillman 发表于 2022-7-6 08:45:05

根据你的图片,这可能很有用,只需要为边界添加几个额外的点
 
2
 
您可以通过基于这两条线伪造一个点来删除中心拾取,但尽管我想看看您是否先使用它,但仍在查看add bpoly无法找到示例

Bill Tillman 发表于 2022-7-6 08:49:01

BIGAL 发表于 2022-7-6 08:53:54

If I am understanding correct you want to hatch the white line area maybe use pick pt1 (left side) pick pt2 (right side) pick pt3 (approx hatch point) then do a pline as per code then just command -hatch pt3 etc I think this what Lee is getting at with addhatch
 
Just me I would do pline as pt1 pt3 pt4 pt5 pt2 using polar the advantage is that you can create defuns so that your hatch works in any quadrant. Thinking further first pick point is actaually line same as second this gives angle of lines, pick near end can work out end of line then, caters for a non square corner.
 
found this addhatch needs some more varables Lee ?
 

;; Set Vlisp Environment variables(setq ActiveDoc (vla-get-activedocument (vlax-get-acad-object)))(setq Space (if (= (getvar "cvport") 1)(vla-get-paperspace ActiveDoc)(vla-get-modelspace ActiveDoc) ))(vlax-invoke space 'addline Pt1 Pt2))(vlax-invoke space 'addarc   cenpt angle1 angle2   )(vlax-invoke space 'addhatch pt1..........) ; needs more answers

BIGAL 发表于 2022-7-6 08:57:41

Did a bit more digging into addhatch never used it before so others may contradict me but basicly you pick a hatch, then create a polyline then use (vlax-invoke Hatch 'AppendOuterLoop) Hatch is the pattern chosen outerloop is the pline. To do my way you would use Bpoly first to create the "outerloop"
 
It is actually there in the HELP just a case of putting it all together. A short cut (command "-hatch" pt1 "") works.
页: [1] 2
查看完整版本: Entmake AR-CONC Hatch为No-