The Hamma Posted June 14, 2025 Share Posted June 14, 2025 If I insert a plugin object in a drawing and the fields are not controlled by the style I can edit the instance of the plugin in the drawings fields. What I would like to be able to do is: Edit the fields of a plugin that are by style with a vectorscript so every instance is edited. If I cannot do that then I would like to be able to insert the styled plugin in the drawing and then convert it to an unstyled plugin using a vectorscript before editing the fields. Anyone know how to do either of these. Quote Link to comment
Pat Stanford Posted June 16, 2025 Share Posted June 16, 2025 I don't understand your question. You can certainly edit the style using a script. Get a handle to the symbol in the Resource Manager that defines the style and use SetRField to change the values in the parameter record. Those changes will apply to every instance of the Styled Object after the changes are made. And those modifications will also apply to all future objects created using the Style. But you will need to know which fields you want to modify and how you want to modify them. I think you can walk the parameter record field by field and see which are ByStyle and which are ByInstance. GetParamStyleType is the function you need to do the test. 0= By Instance. 1 = By Style. Quote Link to comment
The Hamma Posted June 16, 2025 Author Share Posted June 16, 2025 See attached. If I try to set the field of the resource it doesn't work. If I try to set the field once placed in the drawing it does work but only if the field is not by style. I am trying to do option 1. Style Field Set Test.vwx Quote Link to comment
Pat Stanford Posted June 16, 2025 Share Posted June 16, 2025 No time to completely troubleshoot, but you need to get a handle to the PIO inside the Style Red Symbol. FinSymDef. And then make the changes to the record attached to that object. I made it work with door.manuf in the data pane. But even though the change took with the style and the field is set to be ByStyle, it did not propagate into objects on the drawing. Probably need to do a Reset on either the PIO or the Style Sym Def. but I haven't found the right incantation yet. Quote Link to comment
The Hamma Posted June 16, 2025 Author Share Posted June 16, 2025 2 hours ago, Pat Stanford said: FinSymDef Oh! Now I get it and it did work! 1 Quote Link to comment
The Hamma Posted June 16, 2025 Author Share Posted June 16, 2025 Here is a link to the result: 1 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.