Lisp:动态块管理
你好,我正在开发一个简单的程序来绘制抗剪钢筋,但我的砌块有一些问题。
它们是四个:矩形柱、圆形柱、墙端和墙角)。
问题是我需要在它们周围绘制控制部分,这使得我的块在用lisp控制它们时不可预测。
我在矩形块中填充了大量的余约束,这使得它变得很慢(有时是不可预测的)。
我尝试了其他解决方案,但仍然没有找到避免它的方法。例如,我必须做一个_每次更改后与其他块一起重新生成。
(DEFUN inserisci_prop_dyn (/) ;this funcion will change the dynamic proprieties
(putdynpropvalue obj "d" d) ; it changes the offset of the control section from the column/wall
(COND ((= NOME_PIL "Pilastro Rettangolare") ; rectangular column
(COMMAND "_.regen")
(putdynpropvalue obj "c1" c1) ;width
;(COMMAND "_.regen")
(putdynpropvalue obj "c2" c2) ; height
;(COMMAND "_.regen")
(putdynpropvalue obj "cb1" c1) ; it makes even the line that controls the distance from the edge of the slab with the width
(putdynpropvalue obj "cb2" c1) ; for edge column there are 2 parameters for that
(putdynpropvalue obj "cs1" c1) ;this is the same concept but for the edge column
(putdynpropvalue obj "cs2" c2)
(putdynpropvalue obj "cs3" c1) ;cs3 and cs4 are for interior edge column
(putdynpropvalue obj "cs4" c2)
(putdynpropvalue obj "ang_rot" ang_rot) ;that change the rotation of the block
)
((= NOME_PIL "Pilastro Circolare") ;circular column
(COMMAND "_.regen")
(putdynpropvalue obj "c1" c1)
(putdynpropvalue obj "cb1" (/ c1 2))
(putdynpropvalue obj "cb2" (/ c1 2))
(putdynpropvalue obj "cs1" (/ c1 2))
(putdynpropvalue obj "cs2" (/ c1 2))
(putdynpropvalue obj "cs3" (/ c1 2))
(putdynpropvalue obj "cs4" (/ c1 2))
(putdynpropvalue obj "ang_rot" ang_rot)
)
((= NOME_PIL "Angolo Interno") ;wall edge
(putdynpropvalue obj "c1" c1)
(putdynpropvalue obj "c2" c2)
(COMMAND "_.regen")
(SETQ a (/ (* 1.5 d) 100)
b (/ (* 1.5 d) 100)
)
(putdynpropvalue obj "a" a)
(putdynpropvalue obj "b" b)
(putdynpropvalue obj "ang_rot" ang_rot)
(COMMAND "_.regen")
)
((= NOME_PIL "Fine Parete") ;wall end
(putdynpropvalue obj "c1" c1)
;(putdynpropvalue obj "c2" c2)
(SETQ a (MIN c1 (- (* 3 d) (* 0.5 c1)))
b (MIN c1 (- (* 3 d) (* 0.5 c1)))
)
(putdynpropvalue obj "a" a)
(putdynpropvalue obj "b" b)
(putdynpropvalue obj "ang_rot" ang_rot)
)
)
(putdynpropvalue obj "Vista" vista) ;each block can fit each situation: interior, edge, corner. With this line I'll set the right position
(COMMAND "_.regen")
;(IF (AND (= nome_pil "Fine Parete") (= stato_inversione 1)) ;just to flip it, don't mind about that now
;(toggleflipstate obj)
;)
)
我将在那里编写函数“putdynpropvalue”:
;;put dynamic property by property name
(DEFUN putdynpropvalue (obj name value / props names)
(SETQ props (VLAX-INVOKE obj 'getdynamicblockproperties)
names (MEMBER name (MAPCAR 'VLA-GET-PROPERTYNAME props))
)
(VLAX-PUT (NTH (- (LENGTH props) (LENGTH names)) props) 'Value value)
)
我在我的语言论坛上(我来自意大利)寻求帮助,但我没有得到任何帮助。。
我不熟悉动态积木,也许我犯了一些错误。。有人能告诉我如何解决这种情况吗?
Pilastro Rettangolare。这是矩形柱,看一看,你就会明白代码了
谢谢
丹尼斯 您好!
为了让它更清楚,我录制了一段关于我的积木问题的短片。正如您所看到的,墙端完全有缺陷,矩形柱需要很多时间才能插入到图形中(并且存在一些问题)。
精细帕雷特。图纸
有什么建议吗?
谢谢,丹尼斯
页:
[1]