Hi,
I want to open assembly model in Open rep way. I have written the following code but the model is not opening in the required format.
ModelDescriptor desc = pfcModel.ModelDescriptor_Create(ModelType.MDL_ASSEMBLY, ModelName, null);
Model model = session.RetrieveModel(desc);
Assembly assembly = (Assembly)model;
ModelItems mitems = assembly.ListItems(ModelItemType.ITEM_SIMPREP);
int num_simpreps = mitems.getarraysize();
if (mitems == null)
for (int i = 0; i < num_simpreps; i++) {
SimpRep rep = (SimpRep)mitems.get(i);
CreateNewSimpRepInstructions instrs = (CreateNewSimpRepInstructions)rep.GetInstructions();
SimpRepItems simprepitems = instrs.GetItems();
int num_inst = simprepitems.getarraysize();
for (int j = 0; j < num_inst; j++) {
rep.GetSimpRepType();
SimpRepInstructions simpRepInstructions = rep.GetInstructions();
simpRepInstructions.SetDefaultAction(SimpRepActionType.SIMPREP_INCLUDE);
}
assembly.Display();
window = session.GetCurrentWindow();
window.Activate();
Please help me how to get it done this.
thanks,
Srinivas
I want to open assembly model in Open rep way. I have written the following code but the model is not opening in the required format.
ModelDescriptor desc = pfcModel.ModelDescriptor_Create(ModelType.MDL_ASSEMBLY, ModelName, null);
Model model = session.RetrieveModel(desc);
Assembly assembly = (Assembly)model;
ModelItems mitems = assembly.ListItems(ModelItemType.ITEM_SIMPREP);
int num_simpreps = mitems.getarraysize();
if (mitems == null)
for (int i = 0; i < num_simpreps; i++) {
SimpRep rep = (SimpRep)mitems.get(i);
CreateNewSimpRepInstructions instrs = (CreateNewSimpRepInstructions)rep.GetInstructions();
SimpRepItems simprepitems = instrs.GetItems();
int num_inst = simprepitems.getarraysize();
for (int j = 0; j < num_inst; j++) {
rep.GetSimpRepType();
SimpRepInstructions simpRepInstructions = rep.GetInstructions();
simpRepInstructions.SetDefaultAction(SimpRepActionType.SIMPREP_INCLUDE);
}
assembly.Display();
window = session.GetCurrentWindow();
window.Activate();
Please help me how to get it done this.
thanks,
Srinivas