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: 

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

0 REPLIES 0
Reply
Message 1 of 1
CattabianiI
94 Views, 0 Replies

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

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 REPLIES 0

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

Post to forums  

Technology Administrators


Autodesk Design & Make Report