Access Material property fields via iProperty expression?

Access Material property fields via iProperty expression?

Anonymous
Not applicable
1,026 Views
5 Replies
Message 1 of 6

Access Material property fields via iProperty expression?

Anonymous
Not applicable

Wondering what the field names for the properties within a material would be and what the expression would be to enter into and an iProperty. So for example below I would assume something like =<material.comments> but that doesn't seem to work.

2016-11-11_1406.png

0 Likes
1,027 Views
5 Replies
Replies (5)
Message 2 of 6

pball
Mentor
Mentor

There might not be a way to access that. I tried looking for a way to access that with the vba api and couldn't find a method to reference it that way either.

Check out my style edits for the Autodesk forums
pball's Autodesk Forum Style
0 Likes
Message 3 of 6

HermJan.Otterman
Advisor
Advisor

Hello,

 

 

This iLogic rule will set the values for the active material in a part.

 

      Dim oPartDoc As Inventor.PartDocument = ThisApplication.ActiveDocument

        Dim comments As StringAssetValue = oPartDoc.ActiveMaterial("physmat_Comments")
        comments.Value = "Comments"
        Dim manufacturer As StringAssetValue = oPartDoc.ActiveMaterial("physmat_Manufacturer")
        manufacturer.Value = "HJ"
        Dim model As StringAssetValue = oPartDoc.ActiveMaterial("physmat_Model")
        model.Value = "2017"
        Dim cost As StringAssetValue = oPartDoc.ActiveMaterial("physmat_Cost")
        cost.Value = "nothing"
        Dim url As StringAssetValue = oPartDoc.ActiveMaterial("physmat_URL")
        url.Value = "www.cadac.com"

 

If this answers your question then please select "Accept as Solution"
Kudo's are also appreciated Smiley Wink

Succes on your project, and have a nice day

Herm Jan


Message 4 of 6

pball
Mentor
Mentor

It's nice to be proven wrong. I also learned a new trick and to try digging deeper for properties.

Check out my style edits for the Autodesk forums
pball's Autodesk Forum Style
0 Likes
Message 5 of 6

Anonymous
Not applicable

Hello guys!

 

Is it possible to get these information using ILogic from oDocument.ActiveAppearance as well?

Like the Description or Keywords

 

Best Regards. Aron

 

0 Likes
Message 6 of 6

johnsonshiue
Community Manager
Community Manager

Hi! ActiveAppearance() is considered a property of Asset. There are other properties like "Name", "DisplayName", and "CategoryName." Please take a look at Inventor Programming Help. There is good information there.

Many thanks!

 



Johnson Shiue (johnson.shiue@autodesk.com)
Software Test Engineer
0 Likes