Visual Basic Customization

Reply
*HVJ
Message 1 of 3 (40 Views)

Entity

40 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 (40 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 (40 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
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!