Creo VBA API for drawing table update.
I am trying to learn/use this Creo API with my limited Visual Basic (/for applications) knowledge. I am kind of copying and pasting my way thru this. I am trying to create a code using Excel to update the revision block for a set of drawings (the block is dumb). But I can't seem to even get Excel to find the tables in a currently opened drawing. If I can get the code to identfy the table, modify the data in the table, and save the file, I will be a happy camper.
Dont laugh
.....I am a Mechanical not a Software Eng.
Public Sub release_drawing()
On Error GoTo RunError
' This routine will open a Pro/E file from your WorkingDirectory in a new window:
'
Dim asynconn As New pfcls.CCpfcAsyncConnection
Dim conn As pfcls.IpfcAsyncConnection
Dim session As pfcls.IpfcBaseSession
Dim oModel As pfcls.IpfcModel
'Make an asynchronous connection with Pro/ENGINEER
Set conn = asynconn.Connect(Null, Null, ".", 5)
'Get the current session
Set session = conn.session
'List tables found on open drawing
Dim TableObj As pfcls.IpfcTableOwner
Dim table_list As CpfcTables
Set table_list = TableObj.ListTables() '<-----------------------------ERROR OCCURS HERE
MsgBox table_list
'
'bunch of error handling, variable clean up below here, and disconnetion below here that all seems to be funcitoning properly.
'
I have found the documentation for this API lacking to say the least.
If anyone can help it would be greatly appreciated.
Also if anyone knows of some good resources/examples to help learn my way around this Creo API that would help alot as well.
Thanks in advance.
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.
