Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Add a new propertyset

3 REPLIES 3
Reply
Message 1 of 4
Anonymous
241 Views, 3 Replies

Add a new propertyset

I get the following message when i try to add a new propertyset with a new property

Runtime error 429
ActiveX component can't create object

i ran the following code
'Add new propertyset
Dim oNewPropertySet As PropertySet
Set oNewPropertySet = oPropsets.Item("New PropertySettttttxx")
Call oNewPropertySet.Add("a valuex", "new Propertyx", 2)

MsgBox "after new propertyset"


Any ideas?
Janice
3 REPLIES 3
Message 2 of 4
Anonymous
in reply to: Anonymous



class=292161922-14072003>Properties are added sequentially.  I assume you
are adding custom properties.  There are four areas of properties, and the
fourth is custom.  Below, I have a routine that checks my custom properties
(there sre 6 of them).  If any are out of order, it deletes them and readds
them.  Of course, existing values disappear, however once your part files
are setup, everything will be in the correct order and this shouldn't be an
issue.

 

 

Private Sub
ChkUserProp()


face="BakerSignet BT" color=#000080> 
class=292161922-14072003>   Dim oProp4 as
PropertySet

    Dim oPropNew As
Property
    Dim RSP As Boolean  ' Must be used below in
order to set Yes or No option on RSP property!
    Dim i As
Integer

 

    ' Use existing
oProp4 to add properties if they do not exist (oProp4 has not been initially
defined in other sub)
    Set oProp4 =
ThisApplication.ActiveDocument.PropertySets("{D5CDD505-2E9C-101B-9397-08002B2CF9AE}")
   

    ' Delete Properties Example
    ' For
Each oPropNew In oProp4
    '    
oProp4(1).Delete
    ' Next
   

    ' Re-add Properties Example
    ' Set
oPropNew = oProp4.Add("", "Finish")
    ' Set oPropNew =
oProp4.Add("", "MAT'L CODE")
    ' Set oPropNew =
oProp4.Add("", "MATERIAL")
    ' Set oPropNew = oProp4.Add("",
"SUB NO.")
    ' Set oPropNew = oProp4.Add("", "MFG
CODE")
    ' Set oPropNew = oProp4.Add(RSP,
"RSP")
           

    For i = 1 To
oProp4.Count
        Debug.Print
oProp4(i).Name
    Next
i
           

    For i = 1 To (6 -
oProp4.Count)
        Set oPropNew =
oProp4.Add("", "TEMP" + Str(i))
    Next i

 

    If
oProp4(1).Name <> "Finish" Or oProp4(2).Name <> "MAT'L CODE" Or
oProp4(3).Name <> "MATERIAL" Or oProp4(4).Name <> "SUB NO." Or
oProp4(5).Name <> "MFG CODE" Or oProp4(6).Name <> "RSP"
Then
        For Each oPropNew In
oProp4
           
oProp4(1).Delete
        Next

 


color=#000080>        Set oPropNew =
oProp4.Add("", "Finish")
        Set
oPropNew = oProp4.Add("", "MAT'L
CODE")
        Set oPropNew =
oProp4.Add("", "MATERIAL")
        Set
oPropNew = oProp4.Add("", "SUB
NO.")
        Set oPropNew =
oProp4.Add("", "MFG CODE")
        Set
oPropNew = oProp4.Add(RSP, "RSP")
       
MsgBox "Properties Redefined, Check for Properties that may have been
Automatically Changed!"
   
    End
If
  
End Sub


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
I
get the following message when i try to add a new propertyset with a new
property

Runtime error 429
ActiveX component can't create object

ran the following code 'Add new propertyset
Dim oNewPropertySet
As PropertySet
Set oNewPropertySet = oPropsets.Item("New
PropertySettttttxx")
Call oNewPropertySet.Add("a valuex", "new Propertyx",
2)

MsgBox "after new propertyset"


Any ideas?
Janice

Message 3 of 4
Anonymous
in reply to: Anonymous

If oNewPropset is indeed a new propertyset, don't
you need to actually create it with a call to ProperySets.Add?


--
There are 10 kinds of people. Those who understand binary and
those who don't.

 



style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
I
get the following message when i try to add a new propertyset with a new
property

Runtime error 429
ActiveX component can't create object

ran the following code 'Add new propertyset
Dim oNewPropertySet
As PropertySet
Set oNewPropertySet = oPropsets.Item("New
PropertySettttttxx")
Call oNewPropertySet.Add("a valuex", "new Propertyx",
2)

MsgBox "after new propertyset"


Any ideas?
Janice

Message 4 of 4
Anonymous
in reply to: Anonymous

Don't know anything about propertyset, but I love your quote.


"Frank Oquendo" wrote in message >

> There are 10 kinds of people. Those who understand binary and those who
don't.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report