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: 

Changing Line Colors for Individual Parts in Drawing Views With iLogic (not edges)

5 REPLIES 5
Reply
Message 1 of 6
ReneRepina
416 Views, 5 Replies

Changing Line Colors for Individual Parts in Drawing Views With iLogic (not edges)

Hello.

I know there are quite some similar threads on the forum regarding this, but I did not find a solution yet for this way exacly.

 

We have 2 options:

  1. Color the part via "Component Properties". --> There is no found solution for this yet.
  2. Color the part via "Edge Properties". --> Solutions exists (some of them are in below links).

 

We would like to use the 1st option (via "Component Properties"). There is a "manual" option to access those colors via properties, but not sure, if iLogic has this access available (maybe it is currently hard-coded for "manual" change). See below images for comparison betwen "Component Properties" and "Edge Properties". There are both accessible via "Context Menu" (right click on the mouse), the only difference is what it is selected, either whole component or its edges.

 

So the question is: "Is it possible to access "Component Properties" color via iLogic?"

 

Images of "Properties" dialogs:

 

ReneRepina_0-1710359297361.png

ReneRepina_1-1710359343642.png

 

Similar threads (solution for coloring edges of the part):
https://forums.autodesk.com/t5/inventor-programming-ilogic/changing-line-colors-for-individual-parts...

https://forums.autodesk.com/t5/inventor-programming-ilogic/changing-line-colors-for-individual-parts...

 

 

Best regards,

Rene Repina

Labels (7)
5 REPLIES 5
Message 2 of 6

*Wrong post* (deleted)

Message 3 of 6

Hi @ReneRepina.  It looks like both of those dialogs are from within the drawing, right?  Basically the same dialog, but with a different selection set.  Component level (all geometry belonging to that component is selected for edit), or edge level only has the edge selected for edit.  Both are handled the same way by code.  The only way to do that task any quicker or (all at once) would be to change the layer of all the geometry for the component.  To do that, get all its DrawingCurveSegments geometry into an ObjectCollection, then use the Sheet.ChangeLayer method on it.  Beyond that, you would have to reach back into the assembly and change the appearance of the component itself (not the model within the referenced document it represents).  I think certain 'colors' will carry over into the drawing to color its edges when it is not shaded.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

Message 4 of 6
ReneRepina
in reply to: ReneRepina

Hello @WCrihfield .

 

  1. That is correct.
  2. It is interesting that if all edges are selected and changed to a different color, they will overrun any colors that is set on "Component level".
  3. I understand. Well it will still color the "edges" not the "component" (as we can do it manually).
  4. I saw that option with the layer, but I do not look for that though. Thank you for the suggestion.
  5. We have a little bit different workflow for models and drawings. We have different colors on model, but on the drawing we have all edges black.
  6. I assume that there is no direct code possibility to color the whole "Component" (on drawing)?

 

Message 5 of 6
WCrihfield
in reply to: ReneRepina

The only way I know how to change the color of a whole component within a drawing is similar to what you saw at that link in your original post here.  I think we may be able to execute a ControlDefinition while the component (the browser node or its geometry curves) is selected to show that properties dialog, but then we would have no way to control that dialog by code once it was launched.  There is currently no built-in method to put all that geometry into one ObjectCollection then manipulate each of those individual properties for the whole group at once, which is why we must do it while iterating each one.  There are still lots of stuff in Inventor that we can easily do manually, but can not do by code yet (or is super complicated to to by code).  We do not see or know about most of the stuff the software is doing for us behind the scenes while we are doing stuff manually.  Some of it may sound simple, but is a lot more advanced than we realize, requiring tons of code to do it all super efficiently and without crashing.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

Message 6 of 6
ReneRepina
in reply to: WCrihfield

Hello @WCrihfield .

 

Thank you for the answer and explanation. I guess we will go with the current method (by edges) and hope for the code for easier access to such properties.

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

Post to forums  

Autodesk Design & Make Report