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 Get data of all planes of a part?

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

How to Get data of all planes of a part?

Anonymous
Not applicable
I create a part and want to get the normal vector and one point of every plane of the part.
I don't know how to use the function "GetPlaneData()".
The code:

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

Dim oPartDef As PartComponentDefinition
Set oPartDef = oApp.ActiveDocument.ComponentDefinition

Dim oTG As TransientGeometry
Set oTG = oApp.TransientGeometry
For Each oFace In oPartDef.SurfaceBodies(1).Faces
Select Case oFace.SurfaceType
Case kPlaneSurface
Dim oPoint As Point
oPoint = ------------------------what should be here?
Dim oNormal As Vector
oNormal = oFace.Geometry.Normal
Next

thanks!
lancheng
0 Likes

How to Get data of all planes of a part?

I create a part and want to get the normal vector and one point of every plane of the part.
I don't know how to use the function "GetPlaneData()".
The code:

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

Dim oPartDef As PartComponentDefinition
Set oPartDef = oApp.ActiveDocument.ComponentDefinition

Dim oTG As TransientGeometry
Set oTG = oApp.TransientGeometry
For Each oFace In oPartDef.SurfaceBodies(1).Faces
Select Case oFace.SurfaceType
Case kPlaneSurface
Dim oPoint As Point
oPoint = ------------------------what should be here?
Dim oNormal As Vector
oNormal = oFace.Geometry.Normal
Next

thanks!
lancheng
2 REPLIES 2
Message 2 of 3
Anonymous
in reply to: Anonymous

Anonymous
Not applicable
Here's a version of your program that gets the point and vector of each
planar face.

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

Dim oPartDef As PartComponentDefinition
Set oPartDef = oApp.ActiveDocument.ComponentDefinition

Dim oTG As TransientGeometry
Set oTG = oApp.TransientGeometry
For Each oFace In oPartDef.SurfaceBodies(1).Faces
If oFace.SurfaceType = kPlaneSurface Then
Dim oPlane As Plane
Set oPlane = oFace.Geometry
Dim oPoint As Point
Set oPoint = oPlane.RootPoint
Dim oNormal As UnitVector
Set oNormal = oPlane.Normal
End If
Next

--
Brian Ekins
Autodesk Inventor API
0 Likes

Here's a version of your program that gets the point and vector of each
planar face.

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

Dim oPartDef As PartComponentDefinition
Set oPartDef = oApp.ActiveDocument.ComponentDefinition

Dim oTG As TransientGeometry
Set oTG = oApp.TransientGeometry
For Each oFace In oPartDef.SurfaceBodies(1).Faces
If oFace.SurfaceType = kPlaneSurface Then
Dim oPlane As Plane
Set oPlane = oFace.Geometry
Dim oPoint As Point
Set oPoint = oPlane.RootPoint
Dim oNormal As UnitVector
Set oNormal = oPlane.Normal
End If
Next

--
Brian Ekins
Autodesk Inventor API
Message 3 of 3
Anonymous
in reply to: Anonymous

Anonymous
Not applicable
Thanks~~~~~
0 Likes

Thanks~~~~~

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

Post to forums  

Autodesk Design & Make Report