Anuncios

The Autodesk Community Forums has a new look. Read more about what's changed on the Community Announcements board.

Custom LISP file add multiples

bemmer7MZ3G
Contributor

Custom LISP file add multiples

bemmer7MZ3G
Contributor
Contributor

I have a custom LISP program that works great, however it only selects one at a time. Is it possible to add a multiple selection option?

0 Me gusta
Responder
Soluciones aceptadas (1)
885 Vistas
8 Respuestas
Respuestas (8)

vinodkl
Mentor
Mentor

Hello @bemmer7MZ3G 

 

Does this work? See attached :cara_con_una_leve_sonrisa:

--------------------------------------------------------------------------------------------------------------------------
ವಿನೋದ್ ಕೆ ಎಲ್( System Design Engineer)
Likes is much appreciated if the information I have shared is helpful to you and/or others.

Please mark "Accept as Solution" if my reply resolves the issue or answers your question, to help others in the community.
--------------------------------------------------------------------------------------------------------------------------

bemmer7MZ3G
Contributor
Contributor

It says:

 

"Select objects: 1 found, 3 total

Select objects:  ; error: bad argument type: consp <Selection set: 1fc7>"

 

0 Me gusta

vinodkl
Mentor
Mentor

Hello @bemmer7MZ3G 

 

Try this lisp from @Kent1Cooper :cara_con_una_leve_sonrisa:

 

--------------------------------------------------------------------------------------------------------------------------
ವಿನೋದ್ ಕೆ ಎಲ್( System Design Engineer)
Likes is much appreciated if the information I have shared is helpful to you and/or others.

Please mark "Accept as Solution" if my reply resolves the issue or answers your question, to help others in the community.
--------------------------------------------------------------------------------------------------------------------------

bemmer7MZ3G
Contributor
Contributor

I am not sure what is wrong, but that lisp does not work for me at all. Here is part of the file I am working on. I am attempting to convert these polyline circle-like shapes into circles.

0 Me gusta

vinodkl
Mentor
Mentor

Hello @bemmer7MZ3G 

 

From the drawing, I could notice that the closed polyline are not equidistant so they won't be called polygons. You would need a different lisp to work on your requirement.

Apologies, my knowledge of lisp is not very much:cara_sonriente_con_la_boca_abierta_y_sudor_frío: so here is what I found on the forum(See attached) which would work on your requirement. Credits to @Kent1Cooper :cara_con_una_leve_sonrisa:

Type in the command PLS2C to execute the lisp.

--------------------------------------------------------------------------------------------------------------------------
ವಿನೋದ್ ಕೆ ಎಲ್( System Design Engineer)
Likes is much appreciated if the information I have shared is helpful to you and/or others.

Please mark "Accept as Solution" if my reply resolves the issue or answers your question, to help others in the community.
--------------------------------------------------------------------------------------------------------------------------

Kent1Cooper
Consultant
Consultant

Mine called PolygonToCircle.lsp doesn't work in your sample drawing because it requires regular polygons such as the POLYGON command makes [all edges the same length, all vertices the same distance from the center], but:

Kent1Cooper_0-1688138408616.png

The one called PLS2C.lsp does it by drawing a 3-point Circle through the starting vertex and two others approximately 1/3 and 2/3 of the way around, so how the resulting Circle relates to the original Polyline can very a lot depending on how close to circular the original is.

 

Kent Cooper, AIA

bemmer7MZ3G
Contributor
Contributor

I have attached the original file I made which does work on these. I just need to select multiple. I think swapping in SSGET does not work because then it tries to run on the entire selection set instead of each entry. I do not know how to get it to reference each entry as it passes through but I believe I have the loop part correct. The one labeled "Modified" is not currently working and has the loop, the other one works but only on one selection at a time.

0 Me gusta

Kent1Cooper
Consultant
Consultant
Solución aceptada

Here's my approach to [only] adding multiple selection.  I haven't analyzed their method of determining the diameter, but that may be applicable only in some situations, because the command works if I select only the sort-of-circular Polylines, but it hangs up if I include more in the selection, i.e. parts of the Big M.  I would have expected it to make a Circle of some kind and remove the M part, but it stalls instead, and I haven't studied it enough to understand why.  I could try a different diameter determination if this one's problem is a problem for you.

Kent Cooper, AIA