Length and SelectOnScreen Pbm!!

Length and SelectOnScreen Pbm!!

Anonymous
Not applicable
344 Views
5 Replies
Message 1 of 6

Length and SelectOnScreen Pbm!!

Anonymous
Not applicable
Hello,

i'm trying to create a routine which determinate the length of a polyligne that i've slected with the selectonscreen method

1) In fact, as a newbe, i don't really know if it's possible.
2) i just know to method to determinate the lentgh of an polyligne : lenghten and dstr ; but i don't know the startpoint and the endpoint.
3) is it possible to have the coordinate of the polyligne just in selecting it?

i'm lost !! 😞

Thanks for your help
0 Likes
345 Views
5 Replies
Replies (5)
Message 2 of 6

Anonymous
Not applicable
Here is what you need straight from the help file - I combined the sample code for SelectOnScreen and Object.Length [took all of 2 minutes]: Sub Example_SelectOnScreen() ' This example adds objects to a selection set by prompting the user ' to select ones to add. ' Create the selection set Dim ssetObj As AcadSelectionSet Set ssetObj = ThisDrawing.SelectionSets.Add("TEST_SSET") ' Add objects to a selection set by prompting user to ' select on the screen ssetObj.SelectOnScreen 'add selectionset iteration Dim oEnt As AcadObject For Each oEnt In ssetObj Msgbox "Entity length = " & oEnt.Length Next End Sub -- ___________________________ Mike Tuersley CADalyst's AutoCAD Clinic Rand IMAGINiT Technologies
0 Likes
Message 3 of 6

Anonymous
Not applicable
Hi Mike,

I've forgotten to tell that i'm working in vba 6.0 and autocad 2000i. Unfortunately i've tried your code and it didn't work 'cause the property .Length doesn't exist with an AcadObject. The help file said that the property .length is only for line and not pline.

thanks for helping
0 Likes
Message 4 of 6

Anonymous
Not applicable
Joldy, There are many examples down the NG on how to determine length of line/polyline/arc/etc. You can access this NG from Web browser and filter/search for what you are looking for. If you don't find the proper answer there, try visiting http://code.acadx.com/ and take a look at code examples. You may also visit other interesting ACAD links: VBDesign.Net source code examples http://www.vbdesign.net/activecad/source.html AutoCAD VBA examples http://plaza13.mbn.or.jp/~yoda/AutoCADVBAEnglish/ CADalog articles and links http://www.cadalog.com/ ManuSoft Freebies http://www.manusoft.com/software/Freebies/index.stm VBA MS Access Examples http://www.programmingmsaccess.com/Samples/VBAProcs/vba_code_sample_menu.htm Various code examples (VB/VBA...) http://www.planet-source-code.com/ Ukrainean and Russian authors on ACAD (in English) http://www.cad.dp.ua/english/program1e.html One more Russian site on ACAD VBA programming http://www.autocad.ru/cgi-bin/f1/board.cgi?p=025&sort=1 CADDZone http://mysite.verizon.net/~vze2vjds/ XArch ACAD Lisp Examples http://xarch.tu-graz.ac.at/autocad/ etc, etc... Regards, Maksim Sestic "Joldy" wrote in message news:16330104.1079443797905.JavaMail.jive@jiveforum1.autodesk.com... > Hi Mike, > > I've forgotten to tell that i'm working in vba 6.0 and autocad 2000i. Unfortunately i've tried your code and it didn't work 'cause the property .Length doesn't exist with an AcadObject. The help file said that the property .length is only for line and not pline. > > thanks for helping
0 Likes
Message 5 of 6

Anonymous
Not applicable
Thanks for your help 🙂
0 Likes
Message 6 of 6

Anonymous
Not applicable
Sorry, you are right that 2000i makes a difference:)
0 Likes