Announcements

Starting in December, we will archive content from the community that is 10 years and older. This FAQ provides more information.

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

ReneRepina
Collaborator
Collaborator

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

ReneRepina
Collaborator
Collaborator

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

0 Likes
Reply
430 Views
5 Replies
Replies (5)

ReneRepinaLedinek
Participant
Participant

*Wrong post* (deleted)

0 Likes

WCrihfield
Mentor
Mentor

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)

0 Likes

ReneRepina
Collaborator
Collaborator

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)?

 

0 Likes

WCrihfield
Mentor
Mentor

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)

0 Likes

ReneRepina
Collaborator
Collaborator

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.

0 Likes