Hatching with splines boundary has big problems with displaying hatches (maybe not with SOLID but for exapmle with ANSI38 ) so I don't want to use _bpoly.
Problems occurs in most of cad programs (AutoCad; GstarCad; ZWCad).
Below my final version to extend/trim plines.
(defun c:tee4
nil (PZ:FindPlinesToModify
(ssget '
((0 .
"LWPOLYLINE"))))) (defun PZ:FindPlinesToModify
(ss
/ *error* PZ:ExtendPline EntLst tmpLst
) (defun *error* (msg
/ so
) ((member msg '
("Function cancelled" "quit / exit abort"))) (
)
)
)
(defun PZ:ExtendPline
( lst
/ vla_lst pl_m vla_pl_s vla_pl_e tmpLine_s tmpLine_e pts eds pte ede
) )
tmpLine_s
(cd:ACX_AddLine
(cd:ACX_ASpace)
nil
)
tmpLine_e
(cd:ACX_AddLine
(cd:ACX_ASpace)
nil
)
)
(
nil
);skip closed plines
(
(setq pts
(car(LM:intersections tmpLine_s vla_pl_s acextendnone
))) )
(
)
(LM:intersections tmpLine_s vla_pl_s acextendthisentity)
)
)
)
)
)
)
(
nil
);skip closed plines
(
(setq pte
(car(LM:intersections tmpLine_e vla_pl_e acextendnone
))) )
(
)
(LM:intersections tmpLine_e vla_pl_e acextendthisentity)
)
)
)
)
)
)
)
(setq EntLst
(LM:ss
->ent ss
)) ;_1
_2
)
)
(LM:ListDifference EntLst
(list _1
)) )
)
)
;_1
_2
)
)
(LM:ListDifference EntLst
(list _1
)) )
)
)
)
)
)
EntLst
)
)
(foreach _n finalLst
(PZ:ExtendPline _n
)) )
;;-------------------=={ List Difference }==------------------;;
;; ;;
;; Returns items appearing exclusively in one list but not ;;
;; another, i.e. the relative complement: l1 \ l2 ;;
;;------------------------------------------------------------;;
;; Author: Lee Mac, Copyright © 2011 - www.lee-mac.com ;;
;;------------------------------------------------------------;;
;; Arguments: ;;
;; l1,l2 - lists for which to return the difference ;;
;;------------------------------------------------------------;;
;; Returns: List of items appearing exclusively in list l1 ;;
;;------------------------------------------------------------;;
(defun LM:ListDifference
( l1 l2
) )
;;--------------=={ SelectionSet -> Entities }==--------------;;
;; ;;
;; Converts a SelectionSet to a list of Entities ;;
;;------------------------------------------------------------;;
;; Author: Lee Mac, Copyright © 2011 - www.lee-mac.com ;;
;;------------------------------------------------------------;;
;; Arguments: ;;
;; ss - Valid SelectionSet (Pickset) ;;
;;------------------------------------------------------------;;
;; Returns: List of Entity names, else nil ;;
;;------------------------------------------------------------;;
(defun LM:ss
->ent
( ss
/ i l
) )
)
)
To run, please load CadPack functions from this
post.
Thank you
ribarm for help!