Select Contour Labels by Surface

Select Contour Labels by Surface

AllenJessup
Mentor Mentor
820 Views
5 Replies
Message 1 of 6

Select Contour Labels by Surface

AllenJessup
Mentor
Mentor

Is there a way to select Contour Labels by Surface they reference? I copied some labels and changed the Surface they reference. I created layers for each Surface later and now the Labels are on the wrong layer. 

Allen Jessup
CAD Manager - Designer
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

0 Likes
Accepted solutions (1)
821 Views
5 Replies
Replies (5)
Message 2 of 6

ChrisRS
Mentor
Mentor

So surfaces A, B, and C on layers One, Two, and Three. If you temporarily assign a style with contour display off to surfaces A and B you will only see contour elevations for C. I don't know if that helps. I'm away ftom my computer.

Christopher Stevens
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

Message 3 of 6

AllenJessup
Mentor
Mentor

That does work. I was hoping to select by reference Surface so I could see where there were duplicate layers for each surface where the labels are next to each other. I'll have to go through them Surface by Surface. 

This is an area where two surfaces are the same.

AllenJessup_0-1744306305181.png

 

Since I have Sincpac. I can easily toggle the Contours on and off without changing the Style.

Allen Jessup
CAD Manager - Designer
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

0 Likes
Message 4 of 6

AuditInPaperSpace
Advocate
Advocate
Accepted solution

@ChrisRS , unfortunately contour labels can still be selected (via QSELECT or SELECTSIMILAR) even if their parent surface is off/frozen.

 

@AllenJessup , give this lisp a shot: 

(defun c:SELECTBYSURFACE (/ exampleLabel exampleLabelVLA exampleLabelDxfType targetSurfaceName result sslabel i label labelSurfaceName) 
  (setq exampleLabel (car (entsel "\nSelect a label on target surface:")))
  (setq exampleLabelVLA (vlax-ename->vla-object exampleLabel))
  (setq exampleLabelDxfType (cdr (assoc 0 (entget exampleLabel))))
  (setq targetSurfaceName (vlax-get-property (vlax-get-property exampleLabelVLA 'Surface) 'Name))
  
  (setq result (ssadd))


  (setq sslabel  (ssget "x" (list (cons 0 exampleLabelDxfType))))
  (setq i 0)


  (repeat (sslength sslabel)
    (setq label (ssname sslabel i))
    (setq labelSurfaceName (vlax-get-property (vlax-get-property (vlax-ename->vla-object label) 'Surface) 'Name))

    (if (= labelSurfaceName targetSurfaceName)
      (ssadd label result)
    )
    (setq i (1+ i))
  )
  (sssetfirst nil result)
  (princ)
)

 

Someone else on the forum came up with an AutoLISP to select labels by their style, and I've used their code as a starting point. I wish I could remember who it was, but I don't have it written down 😞

Message 5 of 6

AuditInPaperSpace
Advocate
Advocate

@ChrisRS 

I may have misunderstood what you were saying. Because you're right, after you turn the other surfaces off, you could easily layiso and window select all of the labels, and then put them on the right layer. 

0 Likes
Message 6 of 6

AllenJessup
Mentor
Mentor

Thank you. That does what I need. I can now see which are associated with that Surface and move them all to the correct layer at once.

 

AllenJessup_0-1744308061859.png

 

AllenJessup_1-1744308151113.png

 

 

Allen Jessup
CAD Manager - Designer
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

0 Likes