Script to build a line through the points

Script to build a line through the points

Anonymous
Not applicable
590 Views
5 Replies
Message 1 of 6

Script to build a line through the points

Anonymous
Not applicable

Hello.

 

I have something like 3d net created from bars. All bars are 3d solids. I need to chenge bars to lines which must come along main axle of 3d solid. Is it possible to make script for this purpose?

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

hmsilva
Mentor
Mentor
Accepted solution

@Anonymous wrote:

Hello.

 

I have something like 3d net created from bars. All bars are 3d solids. I need to chenge bars to lines which must come along main axle of 3d solid. Is it possible to make script for this purpose?


Hi antoshka_2012,

try this code, pipes by Stefan M.

 

Hope this helps,
Henrique

EESignature

Message 3 of 6

Anonymous
Not applicable
Hello. Thank you for response.

I am newbie in all script stuff and if I understand right, Stefan's script only found central points of cylinders. It is enough complicated for me to make something appropriate from his script.
Also I founded another way to get the point.

But thanks again 🙂
0 Likes
Message 4 of 6

hmsilva
Mentor
Mentor

@Anonymous wrote:
Hello. Thank you for response.

I am newbie in all script stuff and if I understand right, Stefan's script only found central points of cylinders. It is enough complicated for me to make something appropriate from his script.
Also I founded another way to get the point.

But thanks again 🙂
You're welcome, antoshka_2012
Stefan's 'pipes' will create/entmake a 'LINE' in the current layer.
(entmake (list '(0 . "LINE") (cons 10 (car a)) (cons 11 (cadr a))))
Try to create a new layer, run Stefan's code and isolate the new layer to see the new lines...

Hope this helps,
Henrique

 

EESignature

0 Likes
Message 5 of 6

Anonymous
Not applicable
Strangely, I have tried like you writed, but don't had any lines.
0 Likes
Message 6 of 6

hmsilva
Mentor
Mentor

@Anonymous wrote:
Strangely, I have tried like you writed, but don't had any lines.

Strange, I did test the code in a old AC2010, and It worked as expected...

I did post a different approach (very slowly one) in msg#13 'demo_h.lsp' try to remove

(-3 ("CPD1"))
; from
(setq ss (ssget '((0 . "3DSOLID") (-3 ("CPD1")))))

and try the code, it will add lines in layer '_Demo'...

 

 

Hope this helps,
Henrique 

EESignature

0 Likes