First macro VBA - variables text and file name into file properties

Valued Contributor
Valued Contributor

Hello Experts,

 

I would like to kindly ask you for your support. Since I have some Visual Basic skills in Excel I would like to create a macro to fill in file properties automatically. I need it to speed up job for Teamcenter input data and drafts part lists.

 

I am interested in psm files now to add variables (MaterialThickness, text, Flat_Pattern_Model_CutSizeX and Y) like in attached example.

But overally 4 file properties should be filled in by macro like in attached picture. Please see 3 properties on picture and 4th will be TC Item Type = C9_Item, for all run files always.

 

Actually I know how in VB export variables from cells to xls file properties like i.e:

ActiveWorkbook.BuiltinDocumentProperties ("Title") = Range("A1").Value

 

Where I should seek how to create macro with button for SE and...

 

How to export SE variables and text into SE file properties? Can you show me at least an example?

 

 

I will highly appreciate for your constructive support. Thanks a lot!

 

Regards,

 

CB

 

8 REPLIES

Re: First macro VBA - variables text and file name into file properties

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom

Not sure I 100% understand what you're after but I'll put together some sample code and get back with you.

Jason Newell
Applications Architect
www.jasonnewell.net

Re: First macro VBA - variables text and file name into file properties

Valued Contributor
Valued Contributor

Hello Sir,

Four file properties for PSM file should be placed , like on attached previous picture:

1. Document Number - file name
2. Revision Number - A
3. Project Name - Bl. #MMaterialThicknessxFlat_Pattern_Model_CutSizeXxFlat_Pattern_Model_CutSizeY
4. Teamcenter Item Type - C9_Item


For PAR file same as PSM but Project Name should be different depends which PMIs exsists in var table. PMI's off course added manually. The best detal identification should include conditions like:

If PMI Dim's exsists: Linear_1, Linear_1, Linear_3, Linear_4
3. Project Name - Rura kw. Linear_1xLinear_2xLinear_3 - L=Linear_4

If PMI Dim's exsists: Radial_1, Linear_1
3. Project Name - Rura fi Radial_1 - L=Linear_1

If PMI Dim's exsists: Radial_1, Linear_1, Linear_2
3. Project Name - Rura fi Radial_1xLinear_1 - L=Linear_2

Jason, It would be nice to have an open code for further mods and button in ribbon.

Thank you very much Sir.

Re: First macro VBA - variables text and file name into file properties

Pioneer
Pioneer

Check, how overwrite "DocumentSummaryInformation" and "SummaryInformation"

search in SDK or Solid Edge Spy

 

// pl - szukaj w SDK albo SolidEdge Spy

 

Re: First macro VBA - variables text and file name into file properties

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom

I created some VB6 samples of working with file properties in the SolidEdgeCommunity/Samples repository on GitHub. Specifically, take a look at https://github.com/SolidEdgeCommunity/Samples/blob/master/vb6/SolidEdge/FileProperties/Module1.bas.

 

From the sounds of it, you've got the Excel side down so I focused on the SE side.

 

Hope this helps.

Jason Newell
Applications Architect
www.jasonnewell.net

Re: First macro VBA - variables text and file name into file properties

Valued Contributor
Valued Contributor

Hello Experts,

 

Thank you for the part of the code but I do not understand it and I cant build it. I am to fresh to understand this code.

 

The best way would be to learn on a simple example. May someone paste compilable vb.net code for projectinformation customization. I have tried to find any but I couldn't.

 

I would like to add: text, Flat_Pattern_Model_CutSizeX,Y, material thickness as I mentioned before.

 

Thank you for any support. 


jnewell wrote:

I created some VB6 samples of working with file properties in the SolidEdgeCommunity/Samples repository on GitHub. Specifically, take a look at https://github.com/SolidEdgeCommunity/Samples/blob/master/vb6/SolidEdge/FileProperties/Module1.bas.

 

From the sounds of it, you've got the Excel side down so I focused on the SE side.

 

Hope this helps.


 

 

 

Re: First macro VBA - variables text and file name into file properties

Valued Contributor
Valued Contributor

Hello Experts,

 

May somebody upload some simple customization file properties vb.net project? Code should be complabile.

 

Thanks a lot.

 

CB 

Re: First macro VBA - variables text and file name into file properties

Valued Contributor
Valued Contributor
Hi this link is broken, do you have a new link to it?Thanks!! https://github.com/SolidEdgeCommunity/Samples/blob/master/vb6/SolidEdge/FileProperties/Module1.bas.
ST9
Conveyor and industrial equipment designer.
Giving SE a chance.

Re: First macro VBA - variables text and file name into file properties

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom

That's my fault. Things are moving around in the repositories. I've got one more change coming then things should calm down. Fortunately, git captures everything so here is the file from that changeset.

 

https://raw.githubusercontent.com/SolidEdgeCommunity/Samples/d2dfc2f0b6d3c156044b4039d77fcf89b146b23...

Jason Newell
Applications Architect
www.jasonnewell.net