I want to regenerate the current part/model – file with updated values. It works through vb.net process.
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
This thread is inactive and closed by the PTC Community Management Team. If you would like to provide a reply and re-open this thread, please notify the moderator and reference the thread. You may also use "Start a topic" button to ask a new question. Please be sure to include what version of the PTC product you are using so another community member knowledgeable about your version may be able to assist.

