Get IPictureDisp from the Asset object

Get IPictureDisp from the Asset object

Andrii_Humeniuk
Advisor Advisor
758 Views
6 Replies
Message 1 of 7

Get IPictureDisp from the Asset object

Andrii_Humeniuk
Advisor
Advisor

Hello everyone.

 

I want to get IPictureDisp from Asset. For example, the RenderStyle object has a RealisticAppearanceThumbnail method that returns an IPictureDisp to the user, but the Asset object does not have such a method.


Perhaps someone knows how it is possible to do this with Asset, for example, generate a picture based on information in AssetValue.

 

Andrii_Humeniuk_0-1728050619802.png

 

Any help will be appreciated.

Andrii Humeniuk - CAD Coordinator, Autodesk Certified Instructor

LinkedIn | My free Inventor Addin | My Repositories

Did you find this reply helpful ? If so please use the Accept as Solution/Like.

EESignature

Accepted solutions (3)
759 Views
6 Replies
Replies (6)
Message 2 of 7

CGBenner
Community Manager
Community Manager
Accepted solution

Hello, Inventor programming gurus!  Anyone have any ideas on this?

Did you find a post helpful? Then feel free to give likes to these posts!
Did your question get successfully answered? Then just click on the 'Accept solution' button.  Thanks and Enjoy!


Chris Benner
Community Manager

Message 3 of 7

WCrihfield
Mentor
Mentor

Nope.  I know how to access the image files that were supplied within the asset for specifying things like texture, 'cutouts', or 'bumps', but not those small images in that drop-down list within the dialog.  Seems like something that may have been made 'internal' of the Inventor software after the change-over that happened back around 2013, mentioned in the following online help page.

Consistent Materials (Materials and Appearances) 

Maybe there are some 'hidden' properties that I am not aware of, where those 'scene', 'Environment', & 'RenderSettings' specifications are being held, but I am not sure.  I have gone through all available AssetValues of each kind, associated with each type of Asset, and have not found those specifications.  I was going to suggest looking into Attributes, but none of the Asset or AssetValue related object types have any AttributeSets, so that is a dead end also.  We may need to do some 'Reflection' exploration to check for those hidden methods and/or properties, when we find the time.  Not everything is accessible/discoverable that way though, due to how some Type members are defined.  Mike Deck (Autodesk Software Developer) may know if those specifications are accessible to us through regular iLogic rules, add-ins, or exe's.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

Message 4 of 7

JelteDeJong
Mentor
Mentor
Accepted solution

For another question, I created an iLogic rule that writes all values of all assets to the inventor log. That includes a lot image files. Maybe, one of those files is the file that you are looking for. But I did not see it. Anyway, if you want to test/look yourself, then have a look at this post: "Show all appearance values"

Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Blog: hjalte.nl - github.com

Message 5 of 7

WCrihfield
Mentor
Mentor
Accepted solution

Not bad.  I may have to compare notes/techniques.  Attached is a text file containing a similar code tool I keep a copy of in my custom iLogic snippets for inspection purposes.  Maybe not perfect yet, and certainly a long String to write to the iLogic Log window, but it does seem to work OK.  Would probably be better to write it to a text file, or something like that, but the iLogic logger is just so convenient. 😁  I think the StringBuilder is the way to go when we know there will be lots of information being gathered.  The performance is nice, but since this is an inspection too, performance is not really a goal.  Having a single String variable as the result, that can be written out at the end is pretty nice though.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

Message 6 of 7

Andrii_Humeniuk
Advisor
Advisor

First of all, thank you all for your thoughts on this matter. Unfortunately, AssetValue doesn't have the data I need, only some appearance properties.
An idea came to mind, how to easily get a picture:

  1. Copy the desired Asset from the library to the active document.
  2. Receive a picture in the active document through the RenderStyle object.
  3. Delete the previously copied Asset from the active document.

I also wanted to share my observations in working with the AppearanceAsset object. It turns out that there are circumstances when we cannot get Asset from Face. Attached is a part file* that has an iLogic rule "Get Asset from Face" from which you can see that the Face.Appearance method is not working. At the same time, the Face.GetRenderStyle() method works flawlessly.
I found out about the existence of the hidden RenderStyle object recently, how do you understand my app without this method, so it has many disadvantages. I want to release a new update that will simultaneously implement the use of AppearanceAsset and RenderStyle.

 

* - The file is saved in Inventor 2025.

Andrii Humeniuk - CAD Coordinator, Autodesk Certified Instructor

LinkedIn | My free Inventor Addin | My Repositories

Did you find this reply helpful ? If so please use the Accept as Solution/Like.

EESignature

0 Likes
Message 7 of 7

CGBenner
Community Manager
Community Manager

@Andrii_Humeniuk Did the information provided answer your question? If so, please use Accept Solution so that others may find this in the future. Thank you very much!

Did you find a post helpful? Then feel free to give likes to these posts!
Did your question get successfully answered? Then just click on the 'Accept solution' button.  Thanks and Enjoy!


Chris Benner
Community Manager

0 Likes