This lisp add hach with offset 0.50 inside close polyline. I use it to add hach in buildings. I s it possible to add same changes?
1) The building are from lines so is it possible to pick a pointinside the building
2) create a boudary and offset it 0.50
3) add the hach
4)delete the create boudaries
(defun c:OffsetMultiplePolylines
(/ ss offdist direction n en ed pt LL UR MP minpoint maxpoint
area1 area2 newpoly vtx ucsFlag enExtr)
(COMMAND "_layer" "_m" "HATCH" "_c" "171" "" "_lw" "0.18" "" "") (prompt "Select polyline(s): ")
(command "._offset" offdist en pt
"") )
)
)
((= enType "LWPOLYLINE")
)
(T
)
);cond
)
)
)
)
UR
(trans (vlax
-safearray
->list maxpoint
) 0 1) )
;;MP is approximate centroid of polyline - test if in fact inside
(command "._offset" offdist en MP
"") (command "._area" "_object" newpoly
) ;;if new polyline is outside the original, offset it
;;twice the original distance in the other direction
(command "._offset" (* 2.0 offdist
) newpoly pt
"") ;;(entdel newpoly)
)
)
)
)
(command "_hatch" "line" "0.125" "50" en newpoly
"") (command "change" newpoly
"" "P" "LA" "0" "") ;(command "._offset" offdist2 newpoly MP "")
;(setq newpoly2 (entlast))
;(command "change" newpoly2 "" "P" "LA" "P-BUILDING-INT" "")
;;(entdel newpoly)
);;repeat
)
)
);;defun
(defun c:OFFSETBUILDING
() (c:offsetmultiplepolylines)
)
Thanks