Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X
Hi guys,
Now, I want to regenerate the current part/model – file with updated values. It works through manual process.
If I try the below code it show some error, please help me.
Code:
If Not LmodDoc Is Nothing Then
LmodDoc.Display()
session.CurrentWindow.Activate()
new_parameter = LmodDoc
pro = new_parameter.GetParam("Z1")
prov = CType(pro, pfcls.IpfcBaseParameter).Value
prov = (New CMpfcModelItem).CreateDoubleParamValue(40.0)
CType(pro, pfcls.IpfcBaseParameter).Value = prov
pro = new_parameter.GetParam("Z2")
prov = CType(pro, pfcls.IpfcBaseParameter).Value
prov = (New CMpfcModelItem).CreateDoubleParamValue(99.0)
CType(pro, pfcls.IpfcBaseParameter).Value = prov
LmodDoc.RegeneratePostRegenerationRelations()
session.CurrentWindow.Repaint()
paramlist = ""
powner = LmodDoc
params = powner.ListParams()
window = session.CurrentWindow
window.Activate()
window.Refresh()
window.Repaint()
session.GetModelWindow(LmodDoc).Refresh()
session.GetModelWindow(LmodDoc).Repaint()
Dim solid as pfcls.IpfcSolid
If session.CurrentModel.Type = EpfcModelType.EpfcMDL_PART Then
solid = session.CurrentModel
solid.Regenerate(Nothing) --------- i am getting error in this area (attached files)
End If
LmodDoc.RegeneratePostRegenerationRelations()
LmodDoc.Save()
End if
Values are saved without regenerate process. I want regenerate process through coding for auto update the related values.
Regards,
Balaji.S