求助:如何实现对象偏移后变虚线?
本帖最后由 chang1622 于 2023-12-15 11:56 编辑大侠们,请问如何实现对象(直线 圆,椭圆 多段线等)偏移后变白色虚线?
(defun c:oset()
(setq obj (car (entsel "\n选择一个对象: ")))
(setq offsetDist (prompt "\n输入偏移距离: "))
(setq resultId (acdbObjectIdNew obj offsetDist))
(setq es (acdbObjectIdOffset obj offsetDist resultId))
(if (equal es 0)
(repeat 5
(setq entityType (cdr (assoc 0 (acdbObjectIdGetAcDbObjectResultType resultId))))
(if (equal entityType "LINE")
(progn
(setq p0 (acdbObjectIdGetPointResult resultId 0))
(setq p1 (acdbObjectIdGetPointResult resultId 1))
(command "_.dash" p0 p1)
)
)
)
)
)
本帖最后由 lailaifa 于 2023-12-16 10:56 编辑
[*](defun c:tt(/ point pyjl s1 s2)
[*](setq pyjl (getreal "\n输入偏移距离:"))
[*](while
[*] (setq s1 (entsel "\n 选择对象:"))
[*] (setq point (getpoint "\n指定偏移方向:"))
[*] (command "OFFSET" pyjl s1 "non" point "")
[*] (setq s2 (entlast))
[*] (command "CHANGE" s2 "" "P" "LT" "HIDDEN" "S" "50" "")
[*])
[*](command "REGEN")
[*](princ)
[*])
别指望AI 了 全是错误 偏移成功后,用(setq e (entlast))取得它,然后就可以变虚线了 自贡黄明儒 发表于 2023-12-15 07:05
偏移成功后,用(setq e (entlast))取得它,然后就可以变虚线了
(defun c:oset()
(setq obj (car (entsel "\n选择一个对象: ")))
(setq offsetDist (prompt "\n输入偏移距离: "))
(setq resultId (acdbObjectIdNew obj offsetDist))
(setq es (acdbObjectIdOffset obj offsetDist resultId))
(if (equal es 0)
(repeat 5
(setq entityType (cdr (assoc 0 (acdbObjectIdGetAcDbObjectResultType resultId))))
(if (equal entityType "LINE")
(progn
(setq p0 (acdbObjectIdGetPointResult resultId 0))
(setq p1 (acdbObjectIdGetPointResult resultId 1))
(command "_.dash" p0 p1)
)
)
)
)
)
请问错误的地方 lailaifa 发表于 2023-12-16 10:44
[*](defun c:tt(/ point pyjl s1 s2)
[*](setq pyjl (getreal "\n输入偏移距离:"))
[*](while
大佬好!可以再加上偏移几根线吗?谢谢大佬! 榨菜人生 发表于 2023-12-16 11:23
大佬好!可以再加上偏移几根线吗?谢谢大佬!
可以的………
页:
[1]