Loop through all sample lines?

Loop through all sample lines?

Anonymous
Not applicable
843 Views
1 Reply
Message 1 of 2

Loop through all sample lines?

Anonymous
Not applicable

Hi,

 

Im looking for a way to loop through all sample lines. Im using this code for the surfaces but changing the 'Surfaces to 'SampleLines, 'Alignments, etc doesn't seem to work. Someone has any idea how I can loop through all sample lines?

 

 

;create file and init the loop
(setq surfcoll (vlax-get c3ddoc 'Surfaces)
	 surfctr (vlax-get surfcoll 'Count)
	 ctr 0
)

(while (< ctr surfctr)
;etc

 

 

Thanks!

Niels

0 Likes
Accepted solutions (1)
844 Views
1 Reply
Reply (1)
Message 2 of 2

Ranjit_Singh
Advisor
Advisor
Accepted solution

Not sure what the end goal is, so I am just calling vlax-dump-object for each sample line. You can change the code as needed. Minimal testing.

(defun c:somefunc  (/ alignobj)
 (vlax-for i  (vlax-get (vlax-ename->vla-object (car (entsel "\nSelect Alignment: "))) 'samplelinegroups)
  (vlax-for j (vlax-get i 'samplelines) (vlax-dump-object j))))