Sam Jones Posted March 18, 2019 Share Posted March 18, 2019 I want to make a command that sets the fill color of hybrid symbols. How do I access the objects in the symbol to set their fill color, both the 2D and 3D parts of a hybrid symbol? Yet again, TIA Quote Link to comment
Kevin Allen Posted March 18, 2019 Share Posted March 18, 2019 Auto Hybrid? Or all symbols? Quote Link to comment
Sam Jones Posted March 18, 2019 Author Share Posted March 18, 2019 Selected hybrid symbols, no auto hybrid symbols. Quote Link to comment
JBenghiat Posted March 18, 2019 Share Posted March 18, 2019 2D and 3D objects are all together, so start with FInSymDef() and traverse the list. If you want to set attributes differently for 2D and 3D objects, you have to check the object type to see if it is 2D or 3D, and if 2D check to see if the planar ref is set to zero (screen plane). Quote Link to comment
Kevin Allen Posted March 18, 2019 Share Posted March 18, 2019 whoa, above my pay grade... Quote Link to comment
Julian Carr Posted March 18, 2019 Share Posted March 18, 2019 Then you have to consider how the symbols are constructed. Are there container objects within that you need to traverse such as Groups, or PIOs that are controlling fill attributes of objects within independently? Then you will also need to check whether any of the objects have their attributes being controlled by class and respond accordingly. So all in all, not a simple task. Quote Link to comment
Sam Jones Posted March 18, 2019 Author Share Posted March 18, 2019 And well within Josh's and Julian's. I am a little embarrassed about not having remembered "FInSymDef()", but it will do the trick nicely. Right now the symbols will be simple hybrid symbols from the VW truss library, but later on I will need to get into the Profile Group of the TrussItem PIO and then into the symbols contained there in, but that is for later and the same approach can be used... I think. Thanks again Quote Link to comment
JBenghiat Posted March 18, 2019 Share Posted March 18, 2019 The Truss object has a symbol field — so not too hard — just get the name of the symbol and a handle to the definition with GetObject(). When you reset the Truss object, is should replace the contents of the profile group with the modified truss symbol. In theory. Quote Link to comment
Pat Stanford Posted March 18, 2019 Share Posted March 18, 2019 But if you edit the symbol definition that will change all of the instances in the drawing. If I remember where this started from, I think the user wanted to be able to show different groups of truss in different colors. I don't think that is going to work that way. Quote Link to comment
Sam Jones Posted March 18, 2019 Author Share Posted March 18, 2019 Not to worry Pat. This is actually starting from a different place and is a different thread. I have a truss label PIO. This PIO accesses the "Truss Record" to display values in the Truss Label. Which "Truss Record" is used depends on the selected object; it could be a symbol, a group, a "Truss" object (which is really a "TrussItem" object), or a Hanging Position. The Hanging Position presents a more complex problem, since it could be made up of symbols or TrussItems, but it is all doable. However, the "Truss Record" is insufficient for most rigger, ME, LD needs if they are going to bother with labeling their truss/hanging position objects. So... I have added to fields to the "Truss Record", "Bolts" and "Pins". My label PIO can be used with objects using the standard VW Truss Record or my expanded Truss Record. If they use the former they will have access to less data, but labels will work. So... I have written another command that will expand the "Truss Record" of the document which will automatically be applied to objects to which that record is attached, but the values in those fields may not be accurate. So... I have created a command that will allow users to fill in the following "Truss Record" fields, "Truss Color", "Bolts", and "Pins" for selected symbols in the document. While I was doing that, I thought I would let them pick a fill color for the selected symbols. While I was doing that, I thought I would allow them to rename the symbol definitions if they wished. Things keep piling on in my scripting world. There was some concern that my expanded "Truss Record" would play havoc with the "Insert Truss" tool, but my testing seems to indicate it all works fine. As for the user in the other thread, his life would be made easier by my command, but it is unlikely that he will hear about it. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.