Continue to Site

Welcome to MCAD Central

Join our MCAD Central community forums, the largest resource for MCAD (Mechanical Computer-Aided Design) professionals, including files, forums, jobs, articles, calendar, and more.

How to open model along with rep

ssnivas

New member
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
 
Adding one more point to my query is --
SimpRep rep = (SimpRep)mitems.get(i);
any way or any method to display this "rep".

Thanks,
Srinivas
 

Sponsor

Articles From 3DCAD World

Back
Top