startpoint ?

startpoint ?

Anonymous
Not applicable
462 Views
8 Replies
Message 1 of 9

startpoint ?

Anonymous
Not applicable
is it possible to get the startpoint of a polyline like for an arc, aline or Ellipse

Thanks
0 Likes
463 Views
8 Replies
Replies (8)
Message 2 of 9

Anonymous
Not applicable
well, just for fun you could try something like: Sub test() Dim oobj As acadentity Dim vpt Dim sMsg As String Dim stpt As Variant ThisDrawing.Utility.GetEntity oobj, vpt, "Pick something" stpt = GetStartPoint(oobj) If Not IsEmpty(stpt) Then sMsg = TypeName(oobj) & vbCrLf If UBound(stpt) = 2 Then sMsg = sMsg & "Startpoint: " & vbCrLf & "X: " & stpt(0) _ & vbCrLf & "Y: " & stpt(1) _ & vbCrLf & "Z: " & stpt(2) ElseIf UBound(stpt) = 1 Then sMsg = sMsg & "Startpoint: " & vbCrLf & "X: " & stpt(0) _ & vbCrLf & "Y: " & stpt(1) ElseIf UBound(stpt) = 0 Then sMsg = sMsg & "Empty startpoint" End If Else sMsg = "Sorry no ceegar" End If MsgBox sMsg End Sub Function GetStartPoint(oobj As AcadObject) As Variant Dim Rtn As Variant Dim Vstpt As Variant Dim PlStpt(0 To 2) As Double Dim LWPstpt(0 To 1) As Double Dim vVerts As Variant Select Case True Case Is = TypeOf oobj Is AcadPolyline 'Dim oPline As AcadPolyline 'Set oPline = oobj 'vVerts = oPline.Coordinates vVerts = oobj.Coordinates PlStpt(0) = vVerts(0) PlStpt(1) = vVerts(1) PlStpt(2) = vVerts(2) Rtn = PlStpt Case Is = TypeOf oobj Is AcadLWPolyline 'Dim oPline As AcadLWPolyline 'Set oPline = oobj 'vVerts = oPline.Coordinates vVerts = oobj.Coordinates LWPstpt(0) = vVerts(0) LWPstpt(1) = vVerts(1) Rtn = LWPstpt Case Is = TypeOf oobj Is acadline Vstpt = oobj.StartPoint Rtn = Vstpt Case Is = TypeOf oobj Is acadarc Vstpt = oobj.StartPoint Rtn = Vstpt Case Else MsgBox "Sorry, " & TypeName(oobj) & " doesn't have a startpoint" End Select GetStartPoint = Rtn End Function "Joldy" wrote in message news:33375176.1079597841344.JavaMail.jive@jiveforum2.autodesk.com... > is it possible to get the startpoint of a polyline like for an arc, aline or Ellipse > > Thanks
0 Likes
Message 3 of 9

Anonymous
Not applicable
thanks mark,

i'll try this code 🙂
0 Likes
Message 4 of 9

Anonymous
Not applicable
You're welcome, I hope it helps but keep in mind it's just a little bit of an example, not good coding... :-) Mark "Joldy" wrote in message news:28373675.1079699103429.JavaMail.jive@jiveforum2.autodesk.com... > thanks mark, > > i'll try this code 🙂
0 Likes
Message 5 of 9

Anonymous
Not applicable
Mark, with my second post I think u've interstood why I would like to get the start point.

Now my project is completed and I'm glad having found this forum which is very good.

I hope that I'll be able to help other people which the things I've learnt.

Thanks again for everything

Olivier
0 Likes
Message 6 of 9

Anonymous
Not applicable
Hi Mark,

I found your post about the start point of entities. I have a question. Is it possible to move the end point of an arc? I was able to move the end point/start point of a line but for some reason the arc does not work. Could you please give me any suggestions? Thanks.
Alin T
0 Likes
Message 7 of 9

Anonymous
Not applicable
I don't know which mark you're referring to or what post but an arc has
various properties that could determine start point and endpoint
like radius, startangle, endangle, etc
endpoint itself is readonly...it results from combination of other
properties

how you approach your problem would depend exactly what you're trying to
achieve
you may have to use trig to calculate a new angle that would arrive at the
endpoint you're trying to get to.

following are the properties available for an arc object accessible to vba
(RO means read only so you won't be able to change them directly)

; IAcadArc: AutoCAD Arc Interface
; Property values:
; Application (RO) = #
; ArcLength (RO) = 58.4366
; Area (RO) = 486.332
; Center = (63.9458 23.1366 0.0)
; Document (RO) = #
; EndAngle = 2.68506
; EndPoint (RO) = (39.673 35.058 0.0)
; Handle (RO) = "33D"
; HasExtensionDictionary (RO) = 0
; Hyperlinks (RO) = #
; Layer = "0"
; Linetype = "ByLayer"
; LinetypeScale = 1.0
; Lineweight = -1
; Material = "ByLayer"
; Normal = (0.0 0.0 1.0)
; ObjectID (RO) = 2128840616
; ObjectName (RO) = "AcDbArc"
; OwnerID (RO) = 2128833784
; PlotStyleName = "ByLayer"
; Radius = 27.0422
; StartAngle = 0.524117
; StartPoint (RO) = (87.358 36.6699 0.0)
; Thickness = 0.0
; TotalAngle (RO) = 2.16094
; TrueColor = #
; Visible = -1
; Methods supported:
; ArrayPolar (3)
; ArrayRectangular (6)
; Copy ()
; Delete ()
; GetBoundingBox (2)
; GetExtensionDictionary ()
; GetXData (3)
; Highlight (1)
; IntersectWith (2)
; Mirror (2)
; Mirror3D (3)
; Move (2)
; Offset (1)
; Rotate (2)
; Rotate3D (3)
; ScaleEntity (2)
; SetXData (2)
; TransformBy (1)
; Update ()

hth
mark

wrote in message news:6253944@discussion.autodesk.com...
Hi Mark,

I found your post about the start point of entities. I have a question. Is
it possible to move the end point of an arc? I was able to move the end
point/start point of a line but for some reason the arc does not work. Could
you please give me any suggestions? Thanks.
Alin T
0 Likes
Message 8 of 9

Anonymous
Not applicable
Hi, thanks. That confirms my suspicion. What I'm trying to accomplish is this: I have a art type drawing made out of lines and arcs that are not connected (if I want to create a closed polyline from the individual shapes it won't work and I do not want to use the fuzzy feature in pedit). So I wrote a little vba to move the end points of the lines to the end poit or start point of the next entity that is within a certain distance. Like I said before it works fine with the lines but not with the arcs and know I know why. Any easy way to get this done? I would appreciate any suggestions. Thanks.
Alin
0 Likes
Message 9 of 9

Anonymous
Not applicable
well, if a line is near the arc you could move the end or start of the line
to the arc
if you want to adjust the arc to the line, as i mentioned, you will have to
calculate the new properties that would create that new arc
hth
mark

wrote in message news:6254514@discussion.autodesk.com...
Hi, thanks. That confirms my suspicion. What I'm trying to accomplish is
this: I have a art type drawing made out of lines and arcs that are not
connected (if I want to create a closed polyline from the individual shapes
it won't work and I do not want to use the fuzzy feature in pedit). So I
wrote a little vba to move the end points of the lines to the end poit or
start point of the next entity that is within a certain distance. Like I
said before it works fine with the lines but not with the arcs and know I
know why. Any easy way to get this done? I would appreciate any suggestions.
Thanks.
Alin
0 Likes