我正在尝试将autocad命令合并到一个。这些命令用于选择计划表的实体并添加属性集。
第一个命令是:ScheduleSelectionAdd第二个命令是:AecAddAllPropSets
我的代码到目前为止:
(defun c:upDateSchedule()
(command "ScheduleSelectionAdd")
(command "AecAddAllPropSets")
(princ)
)
我也试过这个:
(defun c:upDateSchedule()
(command "ScheduleSelectionAdd" "" "AecAddAllPropSets" "")
(princ)
)
每次它只将我选择的实体添加到表中而不更新我的属性集,所以在这里我被卡住了。
TIA
首先使用ssget
获取选择,然后将选择传递给每个命令,例如:
(defun c:updateschedule ( / sel )
(if (setq sel (ssget "_:L"))
(command
"_.scheduleselectionadd" sel ""
"_.aecaddallpropsets" sel ""
)
)
(princ)
)
这里,:L
模式字符串排除锁定图层上的对象。
请注意,上面假设这些命令只有一个选择对象的提示。