Shrinkwrap a model using Creo VB API
Hi I'm looking for same type of functionality to calculate external surface area.
I'm trying to solve it by using Creo API. I've been going through the Creo API User guide but cannot seem to figure out how to program a button that would create a shrinkwrap model of current active model in session.
Here is the spec:
Hi I would like to program a button for Creo API in VB script for creating a shrinkwrap model.
I've been going through the Shrinkwrap Export section in the Creo API User guide and can not figure out how to program the button.
The button needs to help me create new shrinkwrap model in creo session of the current active model in Creo session. The current active Creo model in session should be allowed to be an asm. or .prt type file.
The newly created shrinkwrap model needs to adhere to the following Shrinkwrap instructions:
- It need to be a faceted type of shrinkwrap model
- The quality of the shrinkwrap needs to be set to 10
- Auto filling of holes needs to happen to shrinkwrap model
This is the outline of code I tried to a certain degree :
Private Sub BTNshrinkwrap_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BTNshrinkwrap.Click
Dim ExportShrinkwrapInstruction As IpfcShrinkwrapModelExportInstructions
Dim activeModel As IpfcSolid
Dim ShrinkWrapModel As IpfcModel
Try
activeModel = asyncConnection.Session.CurrentModel
If activeModel Is Nothing Then
Throw New Exception("Model not present")
End If
ShrinkWrapModel = (New CCpfcShrinkwrapFacetedPartInstructions).Create(activeModel, True).OutputModel
Catch ex As Exception
MsgBox(ex.Message.ToString)
End Try
End Sub
Any help would be appreciated thanks