Message 1 of 16
What tells this
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Ok trying to understand this code but for the life of me I cannot find how it is telling it to be cm instead of inches. Trying to make a sheet metal part with ilogic so I got this from the API sample and got it to work with ilogic but I cannot figure where the cm is to change to inch.
' Create a new sheet metal document, using the default sheet metal template. Dim oSheetMetalDoc As PartDocument oSheetMetalDoc = ThisApplication.Documents.Add(kPartDocumentObject, _ ThisApplication.FileManager.GetTemplateFile(kPartDocumentObject, , , "{9C464203-9BAE-11D3-8BAD-0060B0CE6BB4}")) ' Set a reference to the component definition. Dim oCompDef As SheetMetalComponentDefinition oCompDef = oSheetMetalDoc.ComponentDefinition ' Set a reference to the sheet metal features collection. Dim oSheetMetalFeatures As SheetMetalFeatures oSheetMetalFeatures = oCompDef.Features ' Create a new sketch on the X-Y work plane. Dim oSketch As PlanarSketch oSketch = oCompDef.Sketches.Add(oCompDef.WorkPlanes.Item(3)) ' Set a reference to the transient geometry object. Dim oTransGeom As TransientGeometry oTransGeom = ThisApplication.TransientGeometry ' Draw a 4cm x 3cm rectangle with the corner at (0,0) Call oSketch.SketchLines.AddAsTwoPointRectangle( _ oTransGeom.CreatePoint2d(0, 0), _ oTransGeom.CreatePoint2d(4, 3)) ' Create a profile. Dim oProfile As Profile oProfile = oSketch.Profiles.AddForSolid Dim oFaceFeatureDefinition As FaceFeatureDefinition oFaceFeatureDefinition = oSheetMetalFeatures.FaceFeatures.CreateFaceFeatureDefinition(oProfile) ' Create a face feature. Dim oFaceFeature As FaceFeature oFaceFeature = oSheetMetalFeatures.FaceFeatures.Add(oFaceFeatureDefinition) ' Get the top face for creating the flange. ' We'll assume that the 6th face is the top face. Dim oFrontFace As Face oFrontFace = oFaceFeature.Faces.Item(6) ' Collect up all edges of the face Dim oEdgeCollection As EdgeCollection oEdgeCollection = ThisApplication.TransientObjects.CreateEdgeCollection Dim oEdge As Edge For Each oEdge In oFrontFace.Edges Call oEdgeCollection.Add(oEdge) Next Dim oFlangeDefinition As FlangeDefinition oFlangeDefinition = oSheetMetalFeatures.FlangeFeatures.CreateFlangeDefinition(oEdgeCollection, 3.14159 / 2, "2 in") ' Set the bend radius value oFlangeDefinition.BendRadius = oCompDef.BendRadius.Value * 2 ' Create a flange feature Dim oFlangeFeature As FlangeFeature oFlangeFeature = oSheetMetalFeatures.FlangeFeatures.Add(oFlangeDefinition)
Many thanks..