ambigiousop Posted March 24, 2009 Posted March 24, 2009 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 Quote
CarlB Posted March 24, 2009 Posted March 24, 2009 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. Quote
ambigiousop Posted March 24, 2009 Author Posted March 24, 2009 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? Quote
Lee Mac Posted March 24, 2009 Posted March 24, 2009 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 Quote
BIGAL Posted March 25, 2009 Posted March 25, 2009 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 Quote
BIGAL Posted March 25, 2009 Posted March 25, 2009 have a look at other thread its here twice now Is it what you want ? Quote
Lee Mac Posted March 25, 2009 Posted March 25, 2009 Suggest merging this thread to this one: http://www.cadtutor.net/forum/showthread.php?t=34202 Also, ASMI has a quick dimensioner for plines: http://www.asmitools.com/Files/Lisps/Pdim.html Quote
CarlB Posted March 25, 2009 Posted March 25, 2009 To me the problem description is still a little "ambiguous" by the "op" Can you prepare a sketch with notes? Quote
Lee Mac Posted March 25, 2009 Posted March 25, 2009 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 Quote
Recommended Posts
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.