RamboGT Posted November 28, 2022 Posted November 28, 2022 (edited) I'm trying to figure out how to write a LISP command where I can click on multiple pipe network pipes from an XREF, and it copies them into my current drawing on the current layer, changing the linetype to contiguous, color to ByLayer, and seta global width of 1. Current theory on how this 'might' be accomplished: -click on xref pipe network pipe -it ncopy's item with base point 0,0 -explode items -burst items -set global width of all items to 1 -change linetype to contiguous for all items -change layer to current layer for all items -join all items that are touching (create one polyline from a group of pipe network pipe items) Thoughts? Thanks. --Matt Edited November 28, 2022 by RamboGT Quote
mhupp Posted November 28, 2022 Posted November 28, 2022 (edited) I don't think you can use ncopy with xref. This is what i came up with last February. (might need some tweaking) Edited November 29, 2022 by mhupp 1 Quote
Dadgad Posted November 29, 2022 Posted November 29, 2022 I tried using NCOPY from an Xref just yesterday, and right you are, it works very well with groups or blocks but won't work with an Xref. Quote
ronjonp Posted November 29, 2022 Posted November 29, 2022 This is what I use to copy nested items. (defun c:copyn (/ a b e el i la o ss tm) ;; RJP » 2022-11-29 (sssetfirst nil (setq ss (ssadd))) (while (setq e (nentselp "Select nested object to copy: ")) (cond ((wcmatch (setq a (cdr (assoc 0 (entget (car e))))) "ACAD_PROXY_ENTITY,VERTEX") (princ (strcat "\n" a " not supported...")) ) ((not (setq tm (caddr e))) (princ (strcat "\n" a " item selected is not nested..."))) ((setq el (entget (car e))) ;; Match layer properties after stripping out *| from name if found (and (setq la (entget (tblobjname "layer" (cdr (assoc 8 el))))) (setq i (vl-string-position 124 (cdr (assoc 8 el)) 0 t)) (entmake (subst (cons 2 (setq b (substr (cdr (assoc 8 el)) (+ 2 i)))) (assoc 2 la) la)) ) (setq e (entmakex (append el (list (cons 410 (getvar 'ctab)) (if i (cons 8 b) (assoc 8 el) ) ) ) ) ) (vla-transformby (setq o (vlax-ename->vla-object e)) (vlax-tmatrix tm)) (vla-update o) (ssadd e ss) (princ (strcat "\nEntity created [ " a " ]")) ) ) ) (setvar 'cmdecho 0) (command "_.Draworder" ss "" "_Front") (setvar 'cmdecho 1) (sssetfirst nil ss) (princ) ) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.