Visual Basic Customization

Visual Basic Customization

Reply
*HVJ
Message 1 of 3 (41 Views)

Entity

41 Views, 2 Replies
04-08-2002 09:03 PM
How can I get the startpunkt and the endpoint of a selected line ?, so far
my code is:

dim endpoint1 as variant
dim startpoint1 as variant

ThisDrawing.Utility.GetEntity returnObj, basePnt, "Select an object"


returnObj.Color = acByLayer
returnObj.Update

?? endpoint1 = returnObj.endPoint
?? startpoint1 = returnObj.startPoint

???
*Keith
Message 2 of 3 (41 Views)

Re: Entity

04-08-2002 09:11 PM in reply to: *HVJ
Sub a()
' add declaration for returnObj and basePnt
Dim returnObj As AcadLine
Dim basePnt As Variant
Dim endpoint1 As Variant
Dim startpoint1 As Variant

ThisDrawing.Utility.GetEntity returnObj, basePnt, "Select an object"
returnObj.Color = acByLayer
returnObj.Update

endpoint1 = returnObj.EndPoint
startpoint1 = returnObj.StartPoint

MsgBox "Start point is X" & startpoint1(0) & ", Y" & startpoint1(1) & ",
Z" & startpoint1(2)
MsgBox "End point is X" & endpoint1(0) & ", Y" & endpoint1(1) & ", Z" &
endpoint1(2)

' to limit output to 4 decimals
MsgBox "Start X = " & Format(startpoint1(0), "###0.0000")
End Sub

You might want to include Option Explicit at the top of your module.

hth





"HVJ" wrote in message
news:11B5362D64845C79EF2DE969547C9BC6@in.WebX.maYIadrTaRb...
> How can I get the startpunkt and the endpoint of a selected line ?, so
far
> my code is:
>
> dim endpoint1 as variant
> dim startpoint1 as variant
>
> ThisDrawing.Utility.GetEntity returnObj, basePnt, "Select an object"
>
>
> returnObj.Color = acByLayer
> returnObj.Update
>
> ?? endpoint1 = returnObj.endPoint
> ?? startpoint1 = returnObj.startPoint
>
> ???
>
>
*HVJ
Message 3 of 3 (41 Views)

Re:

04-08-2002 09:24 PM in reply to: *HVJ
Thank you, that's just what I was looking for.


"Keith" skrev i en meddelelse
news:0F566C7606DA26D50229B416E0B778C8@in.WebX.maYIadrTaRb...
> Sub a()
> ' add declaration for returnObj and basePnt
> Dim returnObj As AcadLine
> Dim basePnt As Variant
> Dim endpoint1 As Variant
> Dim startpoint1 As Variant
>
> ThisDrawing.Utility.GetEntity returnObj, basePnt, "Select an object"
> returnObj.Color = acByLayer
> returnObj.Update
>
> endpoint1 = returnObj.EndPoint
> startpoint1 = returnObj.StartPoint
>
> MsgBox "Start point is X" & startpoint1(0) & ", Y" & startpoint1(1) &
",
> Z" & startpoint1(2)
> MsgBox "End point is X" & endpoint1(0) & ", Y" & endpoint1(1) & ", Z"
&
> endpoint1(2)
>
> ' to limit output to 4 decimals
> MsgBox "Start X = " & Format(startpoint1(0), "###0.0000")
> End Sub
>
> You might want to include Option Explicit at the top of your module.
>
> hth
>
>
>
>
>
> "HVJ" wrote in message
> news:11B5362D64845C79EF2DE969547C9BC6@in.WebX.maYIadrTaRb...
> > How can I get the startpunkt and the endpoint of a selected line ?, so
> far
> > my code is:
> >
> > dim endpoint1 as variant
> > dim startpoint1 as variant
> >
> > ThisDrawing.Utility.GetEntity returnObj, basePnt, "Select an object"
> >
> >
> > returnObj.Color = acByLayer
> > returnObj.Update
> >
> > ?? endpoint1 = returnObj.endPoint
> > ?? startpoint1 = returnObj.startPoint
> >
> > ???
> >
> >
>
>
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.