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: 

iLogic - assigning colours

10 REPLIES 10
SOLVED
Reply
Message 1 of 11
SeanFarr
3187 Views, 10 Replies

iLogic - assigning colours

Hello,

 

I am adding paint finish options to my Customization Form and have applied this with no issues. I do however have a request. I understand that the pre-defined colours have to match the exact name and case to be able to be attributed to the Form. Which is fine for most cases, Red, Black, White, but in the instance of Blue, the name is Blue - Wall Paint - Glossy, now I don't mind Blue - Glossy, but Wall Paint is odd. It looks weird and doesn't flow with the rest of the options in my list.  Can this be edited? I assume there is a database file somewhere with all these colours and it can be changed and saved. But would this create issues down the road for Inventor?

 

Thanks

 

Sean

Inventor Pro 2013

Sean Farr
Product Designer at TESInc.ca

Inventor Professional 2014-Update 2 - AutoCAD Electrical 2014
Win7-x64 | ASUS P8Z77-V | i7 3770 -3.4 GHz | 32GB RAM |
240GB SSD | nVidia GTX 670 4GB - 320.49
10 REPLIES 10
Message 2 of 11
adam.nagy
in reply to: SeanFarr

Happy New Year, Sean!

 

As I understand the "Paint" is a user parameter of the part document with a "Multi-Value List". If so, then how are those values used later on?

That would determine if changing those values would have any side effects.

I guess the "Multi-Value List" is filled with some of the RenderStyles' Names? 

 

If I'm misunderstanding the issue, then please provide more information and perhaps a non-confidential part document including the iLogic form that can be used to reproduce the issue on our side.

 

Cheers,



Adam Nagy
Autodesk Platform Services
Message 3 of 11
SeanFarr
in reply to: adam.nagy

Thanks, Happy New Year to you too...

 

I have this form/ilgoic code applied to one of my large assemblies, I will try and make a mock up part with the name issue for you to look at. Will post back soon

 

Thanks

 

Sean

Sean Farr
Product Designer at TESInc.ca

Inventor Professional 2014-Update 2 - AutoCAD Electrical 2014
Win7-x64 | ASUS P8Z77-V | i7 3770 -3.4 GHz | 32GB RAM |
240GB SSD | nVidia GTX 670 4GB - 320.49
Message 4 of 11
SeanFarr
in reply to: adam.nagy

Ok, so I have re-created a simple assembly of the issue. Basically I would to some how make "Blue - Wall Paint - Glossy" just be "Blue".

 

I have created a rule called paint_colour, that in turn is put into a form. easier to adjust colour this way then opening up the parameters window.

 

The paint_colour rule is using a multi value user parameter that is set-up at the assembly level. I set this up using Curtis W. Mastering Inventor 2012 book. It stated that each colour must CASE match exactly what listed in the appearance sections.

 

Again, this is just for aesthetics of my form, it looks funny to see white, black, red and then blue - wall paint - glossy...

 

Appreciate your time!

 

Sean Farr

 

Inventor Pro 2013

Sean Farr
Product Designer at TESInc.ca

Inventor Professional 2014-Update 2 - AutoCAD Electrical 2014
Win7-x64 | ASUS P8Z77-V | i7 3770 -3.4 GHz | 32GB RAM |
240GB SSD | nVidia GTX 670 4GB - 320.49
Message 5 of 11
SeanFarr
in reply to: SeanFarr

I should also add, I am not a programmer by any means, the rules and iLogic applied have been taken from previous posts or from other references (books and youtube).

 

Thanks

 

Sean

Sean Farr
Product Designer at TESInc.ca

Inventor Professional 2014-Update 2 - AutoCAD Electrical 2014
Win7-x64 | ASUS P8Z77-V | i7 3770 -3.4 GHz | 32GB RAM |
240GB SSD | nVidia GTX 670 4GB - 320.49
Message 6 of 11
adam.nagy
in reply to: SeanFarr

Hi there,

 

I don't have that book so I don't know what exact code you are using to fill the "paint_colour" parameter, but in the attached assembly document you already renamed the appearance style to "Blue" so you should be able to use that too in the "paint_colour" value list and so in the iLogic Form.

You can see the the Appearances (RenderStyle in API, Color in iLogic 🙂

Ribbon >> Tools >> Appearance >> Appearance Browser >> Document Appearances

 

If you go into the VBA environment and add to the Watch Window (VBA environment >> View >> Watch Window) the following: ThisApplication.ActiveDocument.RenderStyles("Blue") then you can see that the "Blue" appearance is in fact "Blue - Wall Paint - Glossy", which I think is what you want.

 

I hope this helps.

 

Cheers,

 



Adam Nagy
Autodesk Platform Services
Message 7 of 11
SeanFarr
in reply to: adam.nagy

The paint_colour is applied by selecting a multi-value user parameter and adding the colours manually. For the example I provided I only used Black, Blue - Wall Paint - Glossy and White, see image 1

 

 

The rule is borrowed from a earlier post on this forum, all it does is apply, the selected colour from the user parameter to all parts of the assembly.

 

Dim num As Long
num = ThisApplication.ActiveDocument.ComponentDefinition.Occurrences.Count
jj=1
While jj<num+1
Component.Color(ThisApplication.ActiveDocument.ComponentDefinition.Occurrences.Item(jj).Name) = paint_colour

jj=jj+1
End While
iLogicVb.UpdateWhenDone = True

 

Taken from this post:

http://forums.autodesk.com/t5/Autodesk-Inventor/Color-multiple-parts-in-an-assembly/td-p/3191850#.UP...

 

I set up the rule to work in a form for ease of use.

actual form screen shot: see imgae 2

 

see how the colours are listed from the user parameter. What I want to change, is the blue -wall paint -glossy to just read as 'Blue'

 

example of how i want form to be:  (edited this in microsoft paint)-image 3

 

 

If you explained how to do this in you last post, I didn't understand, sorry.

As I said earlier, My supervisor likes the option of changing the appearance of our products, but he doesn't like how the blue reads a wall [paint glossy, looks funny and it doesn't really make sense. Why can't blue, just be called blue?

 

Thanks

 

Sean

 

Sean Farr
Product Designer at TESInc.ca

Inventor Professional 2014-Update 2 - AutoCAD Electrical 2014
Win7-x64 | ASUS P8Z77-V | i7 3770 -3.4 GHz | 32GB RAM |
240GB SSD | nVidia GTX 670 4GB - 320.49
Message 8 of 11
adam.nagy
in reply to: SeanFarr

Hi Sean,

 

As I said looking in the "Appearance Browser" the "Document Appearances" contains a renamed version of the "Blue - Wall Paint - Glossy", which is now just "Blue"

 

So you could just modify the "paint_colour" parameter value "Blue - Wall Paint - Glossy" to "Blue", and that should work fine too.

 

If you renamed "Blue - Wall Paint - Glossy" to "Blue" in the "Inventor Material Library" as well inside the "Document Appearances" dialog, then I think this "Blue" should be available for all documents not just the one where that style has been used and so has been added to the "Document Appearances"

 

I hope this helps.

 

Cheers,  



Adam Nagy
Autodesk Platform Services
Message 9 of 11
SeanFarr
in reply to: adam.nagy

As I suspected, I didnt understand your previous post,

 

Thanks!!

 

Sean Farr

Sean Farr
Product Designer at TESInc.ca

Inventor Professional 2014-Update 2 - AutoCAD Electrical 2014
Win7-x64 | ASUS P8Z77-V | i7 3770 -3.4 GHz | 32GB RAM |
240GB SSD | nVidia GTX 670 4GB - 320.49
Message 10 of 11
ChristinaForest
in reply to: SeanFarr

Hi!

 

It's possible to make a same multi-value list who come from a appearancel library in A PART???

 

Thanks for help!

Message 11 of 11

i have now

 

Dim colorList As New ArrayList
For Each style As RenderStyle In ThisDoc.Document.RenderStyles
  colorList.Add(Style.Name)
Next
MultiValue.List("INTERIOR_COLOR") = colorList
iProperties.PartColor = INTERIOR_COLOR

 

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

Post to forums  

Autodesk Design & Make Report