本帖最后由 逗亦斗霸 于 2024-9-25 18:14 编辑
- (defun c:tt (/ p0)
- (setq p0 (getpoint "\n起点: ")
- pn (getpoint p0 "\n终点: ")
- jd (angle p0 pn)
- p1 (mapcar '+ p0 '(420 0 0) )
- p2 (mapcar '+ p0 '(0 -210 0) )
- jd1 (angle p0 p2)
- )
- (setq
- pt1 (polar p0 jd 420)
- pt2 (polar p0 (+ jd jd1) 210)
- pt3 (polar pt2 jd 420)
- )
- (entmake
- (list
- '(0 . "hatch")
- '(100 . "AcDbEntity")
- '(67 . 0)
- '(410 . "Model")
- (cons 8 "0")
- '(100 . "AcDbHatch")
- '(10 0.0 0.0 0.0)
- '(210 0.0 0.0 1.0)
- (cons 2 "SOLID")
- '(70 . 1)
- '(71 . 1)
- '(91 . 1)
- '(92 . 1)
- '(93 . 3)
- '(72 . 1)
- (cons 10 p0)
- (cons 11 pt1)
- '(72 . 2)
- (cons 10 pt3)
- '(40 . 210)
- (cons 50 (+ (* pi (/ jd 180.) ) (/ pi 2) ) )
- (cons 51 (+ (* pi (/ jd 180.) ) pi) )
- '(73 . 1)
- '(72 . 2)
- (cons 10 pt2)
- '(40 . 210)
- (cons 50 (+ (* pi (/ jd 180.) ) (* pi 2) ) )
- (cons 51 (+ (* pi (/ jd 180.) ) (* pi 2.5) ) )
- '(73 . 1)
- '(97 . 0)
- '(75 . 1)
- '(76 . 1)
- '(98 . 1)
- (cons 10 p0)
- '(453 . 2)
- '(463 . 0)
- '(463 . 1)
- '(470 . "LINEAR")
- )
- )
- (princ)
- )
此代码水平零角度时可以正常生成我想要的填充样式(图1),但当有角度时则会出现异样(图2和图3),问题应该是出在DXF组码50和51,尝试修改却未成功,现请求大佬指点一下怎么修改?谢谢~ |