transientObjects problems

transientObjects problems

Anonymous
Not applicable
311 Views
1 Reply
Message 1 of 2

transientObjects problems

Anonymous
Not applicable
I've been trying to mirror a feature in a part document using VB and I cant seem to get it right. I keep getting an error: run-time error '429' activex component can't create object

Can anyone help me with this???

Dim oParentFeatures As ObjectCollection
" I get this problem at the line below"
Set oParentFeatures = ThisApplication.TransientObjects.CreateObjectCollection

oParentFeatures.Add oExtFeature

Dim oMirror As MirrorFeature
Set oMirror = oPartDoc.ComponentDefinition.PartFeatures.MirrorFeatures.Add(oParentFeatures, oWorkPlane)
0 Likes
312 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable
ThisApplication is valid only if you are using VBA. If you are using VB, you
can either get a reference to the active Inventor application or create one
as follows:

On Error Resume Next

'obtain the Inventor object if it is already open
Set oInventorApp = GetObject(, "Inventor.Application")

'if Inventor is not open then create Inventor object
If Err Then
'create and access Inventor's Application object
Set oInventorApp = CreateObject("Inventor.Application")

End If

On Error GoTo 0

Also, the line to create the mirror feature should be (replace PartFeatures
with Features):
Set oMirror =
oPartDoc.ComponentDefinition.Features.MirrorFeatures.Add(oParentFeatures,
oWorkPlane)

-Venkatesh Thiyagarjan.

wrote in message news:5120485@discussion.autodesk.com...
I've been trying to mirror a feature in a part document using VB and I cant
seem to get it right. I keep getting an error: run-time error '429' activex
component can't create object

Can anyone help me with this???

Dim oParentFeatures As ObjectCollection
" I get this problem at the line below"
Set oParentFeatures =
ThisApplication.TransientObjects.CreateObjectCollection

oParentFeatures.Add oExtFeature

Dim oMirror As MirrorFeature
Set oMirror =
oPartDoc.ComponentDefinition.PartFeatures.MirrorFeatures.Add(oParentFeatures,
oWorkPlane)
0 Likes