Jump to content
tmd_63

Converting lines to plines

Recommended Posts

tmd_63

I have a number of large files that have multiple layers with many simple objects.

I wish to have a LISP program that searches the file and for certain layers, it looks for line and arcs that have the same start or end points I.E. a line has one end point that matches an arc or another line start point. Once it has found these, it converts the lines or arc into polylines and joins them together.

I have a number of squares or rectangles that are constructed from simple lines and I want to end up with a closed polyline that is the same size as the original rectangle. This could also be an odd shape comprised of arcs and lines that is either open of a closed shape. I wont to convert these to polylines also (either open or closed depending on if the lines are enclosed or open).

Can anyone suggest how to write this. I have very little experience of LISP.

Share this post


Link to post
Share on other sites
halam

Did you work with command:pedit?

select multiple

option join, select all,

I think that would be the basis for doing one drawing

tip: Check lee mac scriptwriter too once

nice tool for working through multiple drawings.

Share this post


Link to post
Share on other sites
ReMark

AutoCAD 2016 I see.

 

You don't need a lisp routine to accomplish the task. You could use the Action Recorder to record a macro (or write it yourself) that uses the PEDIT command, Multiple option and when prompted to select objects type "ALL". Next select the Join option then set the "fuzz factor" to whatever works best for you. Utilize the macro in any drawing at any time since it will always be available to you without having to load anything.

Share this post


Link to post
Share on other sites
tmd_63
AutoCAD 2016 I see.

 

You don't need a lisp routine to accomplish the task. You could use the Action Recorder to record a macro (or write it yourself) that uses the PEDIT command, Multiple option and when prompted to select objects type "ALL". Next select the Join option then set the "fuzz factor" to whatever works best for you. Utilize the macro in any drawing at any time since it will always be available to you without having to load anything.

 

Yes AutoCAD 2016 Mechanical. I have not had much experience of 2016, I normally use 2014. How does the record macro work? and what is the fuzz factor?

This is only the start of my whole project. After finding and converting all squares/rectangles, I then needed to find all the closed polylines that have circles inside them, then convert the poly lines to solids 0.0001 thick and cut out the circles from inside those solids. I will also need to do this for double circles (a larger circle with a smaller circle inside), then find all the rectangles/squares without circles and just convert them into solids 0.0001 thick, then find all the ovals (rectangles with rounded ends) and convert those into solids 0.0001 thick too.

As you can see, this will be a complicated macro to completely write, so I was just starting small.

Edited by tmd_63
factor of 10 out on thickness. oops

Share this post


Link to post
Share on other sites
tmd_63
Did you work with command:pedit?

select multiple

option join, select all,

I think that would be the basis for doing one drawing

tip: Check lee mac scriptwriter too once

nice tool for working through multiple drawings.

How does this command work with 30+ layers when I only need to do this to the objects on 2 layers without turning all the other layers off?

Share this post


Link to post
Share on other sites
ReMark

Now that you have added all your other "conditions" that basically rules out the use of a macro. Good luck programming your routine.

Share this post


Link to post
Share on other sites
tmd_63

attachment.php?attachmentid=58533&cid=1&stc=1

 

This will give you an idea of the results to be achieved. I want to get 3d copper on all the pads using the 2d outlines from a layer top_copper and do the same for a bottom copper layer.

This so far was done manually and involves a lot of steps.

LISP-fill.jpg

Share this post


Link to post
Share on other sites
ReMark

Yes, I can see where it would involve a lot of steps especially considering it is being done after the fact. So is it true that only circles, ovals and rectangles that are of a certain size would have to be converted to a 3D solid or would all of them have to be converted?

Share this post


Link to post
Share on other sites
tmd_63

It is all the rectangles and ovals that do not have a circle inside to become solid boxes or round end boxes. The rectangles, oval or circles with a circle inside need to become donuts etc.

The single lines or single circles do not need a solid being created. As these are plain holes or traces that do not need to be shown.

I have only partly completed the pads in this picture, all the various sized double circles need to be completed too. That is why I was hoping to create a script, LISP or other code that could do this work for me as it is a long slow process doing it manually.

Share this post


Link to post
Share on other sites
ReMark

OK. Thanks for the explanation. Sorry, but I can't think of a way to accomplish the task.

 

If someone here wants to take a crack at it can you provide them with a copy of one of these drawings so they can see how it is set up and for testing purposes? It doesn't have to be an entire drawing but enough so a clear picture of what obstacles have to be overcome to get a routine to properly work.

Share this post


Link to post
Share on other sites
halam

maybe use offor making new outlines is quicker them conversion of lots of lines..

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...