Author Topic: Find out the roll of an PIPE in MEP 2010  (Read 1209 times)

0 Members and 1 Guest are viewing this topic.

commodore

  • Newt
  • Posts: 51
Find out the roll of an PIPE in MEP 2010
« on: January 31, 2011, 03:43:20 PM »
On the attached drawing (or picture if you don't have MEP 2010), you will see that the UCS's on the two pipes are 180 degrees from each other.  This causes problems when using LISP to place the elbow on the end of the pipe.  I'm trying to figure out how to either find out what the current roll of the pipe is to help place the pipe fitting correctly or if I can roll the actually pipe?  I've messed with the normal setting on the pipe with the code below but it's not always dependable due to the pipe being mirrored, user added or program added.  Anyone have any luck determing roll of a pipe?

Code: [Select]
(setq pipeent (entsel))
(setq vlapipe (vlax-ename->vla-object (car pipeent)))
(setq pipenormal (vlax-get-property vlapipe 'Normal))
(setq pipenormalpt (vlax-safearray->list (vlax-variant-value pipenormal)))
(setq normal_x (car pipenormalpt))
(setq normal_y (cadr pipenormalpt))
(setq normal_z (caddr pipenormalpt))
(if (minusp normal_x)(setq normal_x (abs normal_x)))
(if (minusp normal_y)(setq normal_y (abs normal_y)))   
(if (not (minusp normal_z))(setq normal_z (- normal_z)))
(setq pipenormal (vlax-make-variant (vlax-safearray-fill (vlax-make-safearray vlax-vbDouble (cons 0 2)) (list normal_x normal_y normal_z))))
(vlax-put-property vlapipe 'Normal pipenormal)

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Find out the roll of an PIPE in MEP 2010
« Reply #1 on: January 31, 2011, 10:35:55 PM »
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.