cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X

Copy assembly with drawing

LarsZiegler
5-Regular Member

Copy assembly with drawing

Hello!

I have to copy an assembly with components which are instances of familiy table.

In the Proe-GUI the user can call "Save a copy" and select the action "New Name",

so the component isn't a family table instance.

How do I have to do that per Pro/TOOLKIT???

Thanks, Lars


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.
7 REPLIES 7

Lars,
Look up the functions ProMdlfileCopy(), ProMdlBackup(), ProMdlSave().
Depending on your application you may need to use a combination.

Patrick Williams
Sr. Systems Engineer II
Mechanical Engineering Solutions
Missile Systems
Raytheon Company

+1 520.545.6995 (business)
+1 520.545.6399 (fax)
-

TU/M12/8
6221 S Palo Verde Rd
Tucson, AZ 85706 USA
www.raytheon.com



This message contains information that may be confidential and privileged.
Unless you are the addressee (or authorized to receive mail for the
addressee), you should not use, copy or disclose to anyone this message or
any information contained in this message. If you have received this
message in error, please so advise the sender by reply e-mail and delete
this message. Thank you for your cooperation.



LarsZiegler
5-Regular Member
(To:LarsZiegler)

Hello!

Thanks for your answer, Patrick.

I think, I know theese functions well.

It's no problem to copy the assembly to a new name.

The new assembly contains a part which is an instance of a family table.

Does anybody know, how to separate the component from the family table?

Thanks, Lars

FV
17-Peridot
17-Peridot
(To:LarsZiegler)

Hi all,

Lars,

I think the problem you are dealing with is how to determine if a model in session is an instance of family table.ProMdlDataGet would show '<' and '>' in the 'name' ProMdldata structure member for a family instance...

So, the program flow for interactive selection of family instancesshould be something like this:

-Retreive an assembly with an appropriate family instance

-get a list of model in session

-get ProMdldata for each model

-wcschr for '<' in mdldata.name

-ProMdlRename if success

-backup an assembly

HIH.

FV.



In Reply to Lars Ziegler:

Hello!

Thanks for your answer, Patrick.

I think, I know theese functions well.

It's no problem to copy the assembly to a new name.

The new assembly contains a part which is an instance of a family table.

Does anybody know, how to separate the component from the family table?

Thanks, Lars

LarsZiegler
5-Regular Member
(To:LarsZiegler)

Hello Feliks!

Thanks for you answer.

I know that the used component is an instance!

If you copy an assembly with the ProE-userinterface,

you can select "new name" for the component.

With "new name" the new component is a generic model.

I think, in your solution the MdlRename will rename the instance name,

and with MdlBackup you will save the generic model. So we didn't copy the instance

to a normal part.

Greetings Lars

Lars,
Now I understand what you are trying to do. Breaking apart family tables
is a pretty common operation. I know there are some people on this
exploder that have done this with J-Link and Pro/TOOLKIT but since we have
not yet heard from them, I will try even though I have never done it. Here
would be my process:

Assume you have a ProMdl handle to the component with the family table.
Initialize the family table ProFamtableInit()
Check that the family table exists and is not empty ProFamtableCheck()
Get a ProFaminstance handle to the instance. This can be done several
ways depending on what data you have available ProFaminstanceInit() or
ProFamtableInstanceVisit().
Get a ProMdl handle to the instance ProFaminstanceMdlGet()

At this time you have acquired two different handles to the "same"
component model. The first handle is to the component as it was assembled
in the assembly (this is the generic in your case?) and you also have a
different handle to an instance of that component. Now you have to save
the instance handle as a new model and remove it from the original family
table. This will complete the breaking of the family table.

Create a new model in memory with a new name of the instance ProMdlCopy().
You can also save the model to disk by additionally calling ProMdlSave()
or alternatively calling ProMdlBackup() and fill in the model data
structure.
Remove the instance from the family table ProFaminstanceRemove().

I hope this procedure helps you out a bit. Again, I have not done this
before but this seems like a logical procedure to me. I'm only unclear as
to what the best APIs are to save the ProMdl handle of the instance. You
will have to experiment a little on this one. Please let us all know how
it turns out.

Patrick Williams
Sr. Systems Engineer II
Mechanical Engineering Solutions
Missile Systems
Raytheon Company

+1 520.545.6995 (business)
+1 520.545.6399 (fax)
-

TU/M12/8
6221 S Palo Verde Rd
Tucson, AZ 85706 USA
www.raytheon.com



This message contains information that may be confidential and privileged.
Unless you are the addressee (or authorized to receive mail for the
addressee), you should not use, copy or disclose to anyone this message or
any information contained in this message. If you have received this
message in error, please so advise the sender by reply e-mail and delete
this message. Thank you for your cooperation.



Hi Patrick,

A slight correction, adding steps 3,4,&5 to the second part.

1. Assume you have a ProMdl handle to the component with the family
table.
2. Initialize the family table ProFamtableInit()
3. Check that the family table exists and is not empty
ProFamtableCheck()
4. Get a ProFaminstance handle to the instance. This can be done
several ways depending on what data you have available
ProFaminstanceInit() or ProFamtableInstanceVisit().
5. Get a ProMdl handle to the instance ProFaminstanceMdlGet()

At this time you have acquired two different handles to the "same"
component model. The first handle is to the component as it was assembled
in the assembly (this is the generic in your case?) and you also have a
different handle to an instance of that component. Now you have to save
the instance handle as a new model and remove it from the original family
table. This will complete the breaking of the family table.
Create a new model in memory with a new name of the instance ProMdlCopy().

Remove the instance from the family table ProFaminstanceRemove().
Remove the original copy of the instance from memory with ProMdlErase().
Save the copied model to disk with ProMdlSave()
Save the generic with ProMdlSave()



LarsZiegler
5-Regular Member
(To:LarsZiegler)

Hello!

After theese threads I think the normal way is to delete the instance in the famtable

or what i have done:

- delete the whole famtable with ProFamtableErase() and do not save the origin generic model

- Rename the Model and save it

Thanks for the discussion!

Greetings Lars

Top Tags