Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! X
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!
Solved! Go to Solution.
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)
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)