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

Community Tip - Need help navigating or using the PTC Community? Contact the community team. X

Create DRW Table with VBA and VB API

GS_9932064
5-Regular Member

Create DRW Table with VBA and VB API

Hello,

 

I want to create a table in a Creo 4.0 Paramteric drawing with (Excel) VBA and use the VB API.

When I use the CCpfcTableCreateInstructions.Create() I expected to get back an object of type IpfcTableCreateInstructions (like in the PTC user Guide).

But I get a object of type IDpfcTableCreateInstructions.

 

So after many hours of try and error I am desperated.

 

This is my code:

 

Dim TableLocation As CpfcPoint3D
Dim TableCreationInstructionsFactory As CCpfcTableCreateInstructions
Dim TableCreateInstructions As IpfcTableCreateInstructions

 

Set TableLocation = New CpfcPoint3D
TableLocation.Set 0, 0#
TableLocation.Set 1, 0#
TableLocation.Set 2, 0#

 

Set TableCreationInstructionsFactory = New CCpfcTableCreateInstructions

Set TableCreationInstructions = TableCreationInstructionsFactory.Create(TableLocation)

 

When I use the CCpfcTableCreateInstructions.Create() Method I get a variant of type IDpfcTableCreateInstructions back. 

 

I use Creo 4.0 M150.

 

Thanks a lot for support!

 

 

ACCEPTED SOLUTION

Accepted Solutions

Try this code snippet

Dim tableInstructions As IpfcTableCreateInstructions
Dim location As CpfcPoint3D

'======================================================================
'Set table position
'======================================================================
location = New CpfcPoint3D
location.Set(0, 500.0)
location.Set(1, 500.0)
location.Set(2, 0.0)

'======================================================================
'Setup the table creation instructions
'======================================================================
tableInstructions = (New CCpfcTableCreateInstructions).Create(location)

 

View solution in original post

1 REPLY 1

Try this code snippet

Dim tableInstructions As IpfcTableCreateInstructions
Dim location As CpfcPoint3D

'======================================================================
'Set table position
'======================================================================
location = New CpfcPoint3D
location.Set(0, 500.0)
location.Set(1, 500.0)
location.Set(2, 0.0)

'======================================================================
'Setup the table creation instructions
'======================================================================
tableInstructions = (New CCpfcTableCreateInstructions).Create(location)

 

Announcements


Top Tags