Jump to content

Import Data from File to Find X,Y Lengths of Multiple Polylines in AutoCad


Recommended Posts

Posted

I have 2D AutoCad drawings and I am looking to calculate the X and Y distance from 1 point to another. Basically I need to just figure out how long a cable will be. Currently I am creating a poly line and just adding up all the X and Y distances to come up with this length but the process is becomming quite tedious and error-prone. The source and destination points look something like this:

 

Start -> End

a -> 1

a -> 2

a -> 3

a -> b

 

b -> 1

b -> 2

b -> 3

b -> a

 

a and b are different source points on the CAD but they can take a portion of the same cable run to get to their destination: 1, 2, and 3. There are also cross-connects between a and b (which will of course be the same length.) This is only a sample and I have hundreads or source and destination points.

 

Is there anyway in LISP (or even with add-on software) to do these calcualtions? I'd bet that many people have had to do this before. I'd like to actually import a CSV into a program or script and have this all figured out for me.

 

Ideas?

 

zack

Posted

Yes it's possible with lisp.

Post this in the Customization forum & you'll get some responses.

 

But first, could you explain it a more clearly, the a>b stuff is hard to follow. A sketch would help.

Posted

So think of a and b being computer switches and 1,2,3 being workstations. Each workstation has two nics that run to both switches. There is also a cross-connect between a and b.

 

Does this make sense?

Posted

Just a quick one to start us off - haven't got much time:

 

(defun c:leng ()
 (princ
   (strcat "\nLength: "
       (rtos
         (vla-get-Length
       (vlax-ename->vla-object
         (car
           (entsel "\nSelect Pline: ")
           )
         )
       )
         )
       )
   )
 (princ)
 )

 

Select your Pline, and this will give you the length ~ quick and dirty, no error trapping.

 

Lee

Posted

As per Carlb there is a lot of pline lisps it sounds like you need to set A as the start pt then distance from A to each vertice length gets longer (thats what a pline calls them vertice) pretty simple

 

Problem is though if you have lots of plines how do you know which ones are which. To do all in one go is not a problem and say create a text file or send to excell

 

is this example what you want

Pline1 0 10 15 17 25 32

Pline2 0 7 12 15

Pline3 0 7 8 9 10 11

 

(could change there layer as you do them ?)

 

Search here for "pline dimension" its close to what you want seen it in last few days else search "pline" in the customization section only

Posted

have a look at other thread its here twice now

 

Is it what you want ?

Posted

To me the problem description is still a little "ambiguous" by the "op" :)

 

Can you prepare a sketch with notes?

Posted
To me the problem description is still a little "ambiguous" by the "op" :)

 

Can you prepare a sketch with notes?

 

tbh Carl, I was a little perplexed by the request also - which is why I posted just a standard length retriever :huh:

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
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  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...