Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to use functions like

2 REPLIES 2
Reply
Message 1 of 3
Anonymous
291 Views, 2 Replies

How to use functions like

I want to get the axis and radius of the cylinder. There exists one function "GetCylinderData( _
ByRef BasePoint() As Double, _
ByRef AxisVector() As Double, _
ByRef Radius As Double _
) "

I wrote one program to get and print the radius, basepoint and axis of cylinder surface. The code is:

Dim oApp As Inventor.Application
Set oApp = ThisApplication
Dim oFace As Face

if Select Case oFace.SurfaceType = kCylinderSurface
Dim Basepoint(2) As Double
Dim Axis(2) As Double
Dim Radius As Double

Call GetCylinderData(Basepoint, Axis, Radius)
Print #FileNum, Basepoint(0); Basepoint(1); Basepoint(2); Radius; Axis(0); Axis(1); Axis(2)

end if

But it seems that I can't use the function like this.How to use the function?

Thanks!
2 REPLIES 2
Message 2 of 3
Anonymous
in reply to: Anonymous

The GetCylinderData function is a method of the Cylinder object. You get a
Cylinder object from a face whose geometry is cylindrical. In your sample
code you're already checking to see if the face is a cylinder. All you need
to do is change the line

Call GetCylinderData(Basepoint, Axis, Radius)

to

Call oFace.Geometry.GetCylinderData(Basepoint, Axis, Radius)

The Geometry property of the Face will return the corresponding geometry
object, which in this case will be a Cylinder object.
--
Brian Ekins
Autodesk Inventor API


wrote in message news:5907156@discussion.autodesk.com...
I want to get the axis and radius of the cylinder. There exists one function
"GetCylinderData( _
ByRef BasePoint() As Double, _
ByRef AxisVector() As Double, _
ByRef Radius As Double _
) "

I wrote one program to get and print the radius, basepoint and axis of
cylinder surface. The code is:

Dim oApp As Inventor.Application
Set oApp = ThisApplication
Dim oFace As Face

if Select Case oFace.SurfaceType = kCylinderSurface
Dim Basepoint(2) As Double
Dim Axis(2) As Double
Dim Radius As Double

Call GetCylinderData(Basepoint, Axis, Radius)
Print #FileNum, Basepoint(0); Basepoint(1); Basepoint(2); Radius;
Axis(0); Axis(1); Axis(2)

end if

But it seems that I can't use the function like this.How to use the
function?

Thanks!
Message 3 of 3
Anonymous
in reply to: Anonymous

It works.
Thank you.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report