How To Use: Convert To SheetMetal With VB.NET2005

Valued Contributor
Valued Contributor

 

Hi all,

I am wrote a code that find the largest face in the active sheet metal

document body.

there is a ConvToSMs.add(RefFace,[],[],[],[])    function that need to get

RefFace and some optional args.

When I enter the largestFace  that I found I get Error Msg (atached to this

mail)

how should i define RefFace?

the code is:

 

Sub

SEconvertToSM(ByVal SMmodel As SolidEdgePart.Model)Dim SEbody As SolidEdgeGeometry.BodyDim SEfaces As SolidEdgeGeometry.FacesDim SEface As SolidEdgeGeometry.FaceDim SETopface As SolidEdgeGeometry.Face'Dim refFace As SolidEdgeFramework.Reference

SETopface = Nothing

SEbody = SMmodel.Body

SEfaces = SEbody.CreateCollection(SolidEdgeGeometry.TopologyCollectionTypeConstants.seFaceCollection)

SEfaces = SEbody.Faces(SolidEdgeGeometry.FeatureTopologyQueryTypeConstants.igQueryPlane)

 

 ForEach SEface In SEfacesIf SETopface IsNothingThen

SETopface = SEface

 EndIf

 If SEface.Area > SETopface.Area Then

SETopface = SEface

 EndIf

 Next

 SMmodel.ConvToSMs.Add(SETopface))

SEbody = Nothing

SEfaces = Nothing

SEface = Nothing

SETopface = Nothing

 EndSub

 

 

 

Thanks,

 Amir

 

 

 

 

 

Amir

 

 

 

 

 

 

Posted by: amir zeltzer
Post date: 11/29/2007 8:01:17 AM