TheSwamp

CAD Forums => Vertically Challenged => Topic started by: entget on October 08, 2021, 01:25:29 PM

Title: Find pipe structure in plan from profile view
Post by: entget on October 08, 2021, 01:25:29 PM
I have a pipe structure in profile I want to reference to a different surface ...by selecting the structure in profile, selecting the desired surface in profile - instead of select structure, right click, structure properties, reference surface, pick ellipsis, pick other surface, select ok, select ok

...what I think I need to do is select the structure in profile, get the source objects name and change the surface there (the 'plan' view of it)

I am stuck after selecting the profile structure - is the GetModelNetworkPart method what I need? ...or am I chasing the unobtainable?

Thanks!
Title: Re: Find pipe structure in plan from profile view
Post by: Jeff_M on October 11, 2021, 04:51:35 PM
Yes, that is the method to use.
Title: Re: Find pipe structure in plan from profile view
Post by: BlackBox on October 12, 2021, 09:50:55 AM
Code - Lisp: [Select]
  1. (vl-load-com)
  2.  
  3. (defun c:SsPartsInPlan (/ *error* parts ss)
  4.  
  5.   (defun *error* (msg)
  6.     (if ss (vla-delete ss))
  7.     (cond ((not msg))                                                   ; Normal exit
  8.           ((member msg '("Function cancelled" "quit / exit abort")))    ; <esc> or (quit)
  9.           ((princ (strcat "\n** Error: " msg " ** ")))                  ; Fatal error, display it
  10.     )
  11.     (princ)
  12.   )
  13.  
  14.   (if (ssget "_:L" '((0 . "AECC_GRAPH_PROFILE_NETWORK_PART")))
  15.     (progn
  16.       (setq parts (ssadd))
  17.       (vlax-for x (setq ss (vla-get-activeselectionset
  18.                              (vla-get-activedocument
  19.                                (vlax-get-acad-object)
  20.                              )
  21.                            )
  22.                   )
  23.         (setq parts (ssadd
  24.                       (vlax-vla-object->ename
  25.                         (vlax-invoke x 'getmodelnetworkpart)
  26.                       )
  27.                       parts
  28.                     )
  29.         )
  30.       )
  31.       (sssetfirst nil parts)
  32.     )
  33.   )
  34.   (*error* nil)
  35. )
  36.  
Title: Re: Find pipe structure in plan from profile view
Post by: entget on October 12, 2021, 01:52:22 PM
thank you both! ...it seems the more i program, the fewer the resources or examples are available for what i'm after - appreciate the help very much!! the swamp never fails!!