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

Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X

Replace VBA copy of generic drawing with family instance

HaGs
10-Marble

Replace VBA copy of generic drawing with family instance

Hello community,

I want to use VBA (Excel) to copy a generic drawing (in the Windchill workspace) and replace the model in that copy with a family instance.

Basically the way you would do it manually:

Generic Drw "save as", enter new name, call up copy, then "replace model", select family instance.

But how can this be realized with VBA, if possible without mapkeys?

If I do it with Mapkey, then I have to enter the file names manually too often!

I use Creo 5.0 and Windchill.

 

Translated by the Community Moderation using Google Translate
-----------------------------------------------------------------------------------------------

Hallo Community,

ich möchte mit VBA (Excel) eine generische Zeichnung kopieren (im Windchill-Workspace), und das Modell in dieser Kopie mit einer Familieninstanz ersetzten.

Im Prinzip so wie man es manuell machen würde:

Generische Drw "speichern unter", neuen Namen eingeben, Kopie aufrufen, dann "Modell ersetzten", Fam. Instanz auswählen.

Aber wie lässt sich das mit VBA realisieren, möglichst ohne Mapkeys ?

Wenn ich es mit Mapkey mache, dann muss ich zu oft die Dateinamen manuell eingeben !

Ich benutze Creo 5.0 und Windchill.

 

 

 

 

 

 

 

2 REPLIES 2
YaroslavSin
17-Peridot
(To:HaGs)

IpfcBaseSession.OpenFile() - open a drawing
IpfcModel.Copy() - make a copy
IpfcModel2D.GetCurrentSolid() - get a model of the drawing
IpfcFamilyMember.GetRow() - find instance by name
IpfcFamilyTableRow.CreateInstance() - get a model of the instance
IpfcModel2D.ReplaceModel() - replace drawing model

 

Also check code examples at

...\Creo x.0.x.0\Common Files\vbapi\vbapi_examples

 

Hi YaroslavSin,

 

many thanks for your response.

Very interesting, I will test that, helps me a lot.

 

All the best

 

Translated by the Community Moderation using Google Translate
-----------------------------------------------------------------------------------------------

Hi  YaroslavSin,

 

vielen Dank für deine Antwort.

Sehr interessant, das werde ich testen, hilft mir sehr viel weiter.

 

Alles Gute

 
Announcements


Top Tags