打算做一个多段线生成铝板的代码,但只能实现正方向拐角圆角的大小,在反方向拐角的圆角大小是反的,请求指导一下修改的思路;
另外现在的代码,当画出两条或以上的多段线后,再运行选择其中一条多段线生成铝板,出现图片中的结果,请问代码中哪里出问题?- (defun C:FP ()
- (vl-load-com)
- (setq S1 (entsel "\n选择线:"))
- (setq PO (getpoint "\n指定偏移方向:"))
- (command "OFFSET" 3 S1 PO "");偏移铝板厚度3mm
- (setq S2 (entlast))
- (command "FILLET" "R" 4 "");圆角4mm
- (command "FILLET" "P" S1)
- (command "FILLET" "R" 1 "");圆角1mm
- (command "FILLET" "P" S2)
- (command "FILLET" "R" 0 "");恢复圆角0mm
- (setq PT1 (vlax-curve-getStartPoint (car S1)));获取S1开始点
- (setq PT2 (vlax-curve-getEndPoint (car S1)));获取S1结束点
- (setq PT3 (vlax-curve-getStartPoint S2));获取S2开始点
- (setq PT4 (vlax-curve-getEndPoint S2));获取S2结束点
- (command "PLINE" PT1 PT3 "")
- (setq S3 (entlast))
- (command "PLINE" PT2 PT4 "")
- (setq S4 (entlast))
- (command "PEDIT" "M" S1 S2 S3 S4 "" "J" 0.0 "")
- (setq SS (entlast))
- (if (null (tblsearch "layer" "Alum._ Panel"))
- (command "layer" "m" "Alum._ Panel" "C" "150" "" "L" "" "" ""))
- (if (null (tblsearch "layer" "Hatch_Alum."))
- (command "layer" "m" "Hatch_Alum." "C" "253" "" "L" "" "" ""))
- (command "chprop" SS "" "La" "Alum._ Panel" "")
- (command "layer" "s" "Hatch_Alum." "")
- (command "-bhatch" "P" "SOLID" 1 0 "s" SS "" "")
- (command "layer" "s" "0" "");返回0层
- (princ)
- )
|