Starting in December, we will archive content from the community that is 10 years and older. This FAQ provides more information.
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:
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:
Similar threads (solution for coloring edges of the part):
https://forums.autodesk.com/t5/inventor-programming-ilogic/changing-line-colors-for-individual-parts...
Best regards,
Rene Repina
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
(Not an Autodesk Employee)
Hello @WCrihfield .
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
(Not an Autodesk Employee)
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.