ReDim Preserve ptx(0 To countxx - 1) 'Re-dimension the ptx variable. Set pointx = (ptx)Ĭountxx = countx * 2 'Multiply count number by 2 (to get correct array numbers). Ptx = (, "Pick the first point.") 'Getpoint method.Ĭountx = countx + 1 'Add 1 to the counter. All it does so far is to add a AcadPoint at each selected point, then show the number of points (a msgbox purely for my purposes to show me that the code is working OK), then the polyline is only drawn from 0,0 to the last selected point!!ĭim pointx As AcadPoint 'Add an AcadPoint at each selected point, to show where user has already picked.ĭim ptx As Variant 'Point array (multiple if necessary).ĭim polyXX As AcadLWPolyline ' Polyline to be drawn from the points array.ĭim countx As Integer 'Counter for loop.ĭim countxx As Double 'Counter value * 2 (to get correct point array numbers (X,Y)).Īreaform.hide 'Hide form to allow user to slect points from AutoCAD. What I can't do is set up the program to accept all the selected points into the vertex list for the polyline.Īnyway, here's a selection of the code. Then it deletes the polyline so all the user sees is the results. Then the progam draws a polyline using the points selected as it's vertexes and then get the area of the polyline. The problem I have is that I'd like the user to be able to select as many point as required (will always be random) to draw the desired shape of the room or whatever. So far I've got the 'Select Entity part down, which simply asks the user to select a polyline object already drawn, then the program displays the formatted result on the form, then if needed, the user can insert the result as Text. I'm trying to write a small VBA program that the user can use to get the area of any shape and then it'll format the results to show in metre-squared (this is for calculating floor area). Now I got some of the code I'm constructing to show you. I've asked this question before, but had no real good replies from it to with VBA.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
January 2023
Categories |