arc data from function back to multiple forms

arc data from function back to multiple forms

Anonymous
Not applicable
320 Views
3 Replies
Message 1 of 4

arc data from function back to multiple forms

Anonymous
Not applicable
I need some help passing arc entity data back into many forms and sub
routines from a function..

'in form1
Call GetEnt ' in form1 call function

'function in module1

Public Function GetEnt() As AcadEntity
Dim ent As AcadEntity
Dim arc As AcadArc
On Error Resume Next
ThisDrawing.Utility.GetEntity ent, "Select Curve to Insert block: "

If TypeOf ent Is AcadLWPolyline Then
MsgBox " Please Select Arc, Entity was not an ARC."
End If

If TypeOf ent Is AcadArc Then
Set arc = ent
STRarclength = arc.arclength
STRCENTERPT = arc.Center
'what do i do here to send arc data back?
End If
End Function

'return back to form1
'need to hand off the ent data Arc, arclength, arc.Center from the function

'how do I call arc data from function to be used here?
userform1.Textbox5.text = lightsset = STRarclength / 50
userform2.Textbox5.text = lightsset = STRarclength / 50

any help is appreciated.

Thank you
John
0 Likes
321 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable
Hi, John
Please look at this line:
If TypeOf ent Is AcadLWPolyline Then
MsgBox " Please Select Arc, Entity was not an ARC."
End If

If you need to sure that you've selected an arc
this string must be like this:

If Not TypeOf ent Is AcadArc Then
MsgBox " Please Select Arc, Entity was not an ARC."
"""""
End If

Hope you'll understand me

~'J'~
0 Likes
Message 3 of 4

arcticad
Advisor
Advisor
A LWPolyline can also be an Arc. I think what you need to look at is the Bulge of the LWPolyline.

I did a quick search for "polyline arc bulge" and there are lots of posts.
---------------------------



(defun botsbuildbots() (botsbuildbots))
0 Likes
Message 4 of 4

Anonymous
Not applicable
Fatty, arcticad

Thank you for the help with the If Not TypeOf ent Is AcadArc I will change
that.

The area that I was trying to find out was how to save the arc and data
associated with the arc from the function so that it can be used outside a
single routine. The original routine had the selection of the ent in a
private sub in form1. I then saved the arc.length and others data in module1
that I declared as public. The problem was able to save the associated data
like arc length, radius to module1 but I could pass the ent itself to
module1 to other sub routines in different forms so I could insert blocks
and label that arc.

call the function

do something

how do I return to the routine with the ent/arc and also save in module1 so
it could be used in other forms

I guess I don't understand the argument statements in functions and if and
when they are need in all functions


Thank you
John



wrote in message news:5491617@discussion.autodesk.com...
A LWPolyline can also be an Arc. I think what you need to look at is the
Bulge of the LWPolyline.

I did a quick search for "polyline arc bulge" and there are lots of posts.
0 Likes