it seems to be ignored NonParametricBaseFeatureDefinition.OutputType set to Solid in a sheet metal

it seems to be ignored NonParametricBaseFeatureDefinition.OutputType set to Solid in a sheet metal

CattabianiI
Collaborator Collaborator
140 Views
0 Replies
Message 1 of 1

it seems to be ignored NonParametricBaseFeatureDefinition.OutputType set to Solid in a sheet metal

CattabianiI
Collaborator
Collaborator

These are lines I extracted from a command in my add-in. It behaves correctly in a standard part but not in a sheet metal part. Please check the video or follow these steps:

  1. Paste the rule below into an external rule.
  2. Open a sheet metal part.
  3. Run the rule twice, selecting an IPT file each time.
  4. If you check the log, you will see that you are supposed to create a solid, but it is not visible in the view.
Sub main()
	Dim thisCmpDef As PartComponentDefinition = ThisDoc.Document.ComponentDefinition
	
	Dim fileToimport = SelectIptFromDisk()
	Dim importedCmpDef As PartComponentDefinition = ThisApplication.Documents.Open(fileToimport, False).ComponentDefinition
	Dim importedBody As SurfaceBody = importedCmpDef.SurfaceBodies.Item(1)
	
	Dim oCollection As ObjectCollection
	oCollection = ThisApplication.TransientObjects.CreateObjectCollection
	oCollection.Add(importedBody)
	
	Dim baseFeatureDef As NonParametricBaseFeatureDefinition
	baseFeatureDef = thisCmpDef.Features.NonParametricBaseFeatures.CreateDefinition
	baseFeatureDef.BRepEntities = oCollection
	baseFeatureDef.OutputType = BaseFeatureOutputTypeEnum.kSolidOutputType
	Logger.Info(baseFeatureDef.OutputType)
	
	Dim oBaseFeature1 As NonParametricBaseFeature =
	thisCmpDef.Features.NonParametricBaseFeatures.AddByDefinition(baseFeatureDef)
	Logger.Info(oBaseFeature1.IsSolid)
End Sub

Function SelectIptFromDisk() As String
	Dim openFileDialog As Inventor.FileDialog = Nothing
	InventorVb.Application.CreateFileDialog(openFileDialog)
	openFileDialog.DialogTitle = "Select .ipt File"
	openFileDialog.Filter = "Autodesk Inventor Files (*.ipt)|*.ipt"
	openFileDialog.ShowOpen()
	Return openFileDialog.FileName
End Function

 

 

0 Likes
141 Views
0 Replies
Replies (0)