AutoLISP C3D: Sample Line 0-point and volume surfaces

AutoLISP C3D: Sample Line 0-point and volume surfaces

Anonymous
Not applicable
1,245 Views
2 Replies
Message 1 of 3

AutoLISP C3D: Sample Line 0-point and volume surfaces

Anonymous
Not applicable

Hi,

 

I was coding a function and have a few question.

 

1. I'm doing a loop through the surfaces to do some actions. How can I filter out volume surfaces?

(while (< ctr surfctr)
	(setq surf (vlax-get-property surfcoll 'Item ctr) 
	surfname (vlax-get surf 'Name))
	(setq p3 p1xy)
	(while (< (distance p1xy p3) (distance p1xy p2xy))
	;etc

2. How do I find the 0-point of the Sample Line? (The point where the Alignment crosses the Sample Line)

(setq vtxs (vlax-get sampleline 'Vertices))
(setq p1 (vlax-invoke vtxs 'Item 0)
  p2 (vlax-invoke vtxs 'Item 1)
  p1xy (list (car (vlax-get p1 'Location)) (cadr (vlax-get p1 'Location)))
  p2xy (list (car (vlax-get p2 'Location)) (cadr (vlax-get p2 'Location)))
)

Thanks in advance!

0 Likes
Accepted solutions (1)
1,246 Views
2 Replies
Replies (2)
Message 2 of 3

Ranjit_Singh
Advisor
Advisor
Accepted solution

Checking if the volumes method is available for a particular surface type is one way of telling if it's a volume surface

(vlax-method-applicable-p (vlax-get surf 'statistics) 'volumes)

If the above returns true then it's a volume surface.

For intersection of sample line with alignment, invoke the intersectwith method

(vlax-invoke sampleline 'intersectwith (vlax-get (vlax-get sampleline 'parent) 'parent) acextendnone)
Message 3 of 3

Anonymous
Not applicable

Thanks! I implemented this into the code and it works!

0 Likes