VvierA Posted October 14, 2012 Share Posted October 14, 2012 Hello, I made a custom 2d path object tool to generate special 2d polygons. It works great and I can use the tool to generate the polygons. The problem is: If I try to change the class of the PIO afterwards the polygon does not adopt the graphic attributes (line color, line weight etc.) of the new class. Do you have any hints? Thank you, VvierA P.S. I generate the polygon by using the 2d path tool and with 'CreateDuplicateObject'. Quote Link to comment
Miguel Barrera Posted October 15, 2012 Share Posted October 15, 2012 When you change the class, it only changes the pio itself, the container, but not the objects contained within. This behavior is the same as in symbols, where the symbol can belong to a different class from the objects it contains. You need to get the name of the pio class and then set it as the active class so that all the objects drawn within the pio are created under the same class. I use this flexibility to hide or change the appearance of the objects. I usually create the pio with a class for a group of related pio's (i.e. furniture,signals,etc) so that the whole group can be hidden in certain views. The objects within are created in other classes to show different states as in existing, proposed, removed, salvaged, etc. Quote Link to comment
VvierA Posted October 15, 2012 Author Share Posted October 15, 2012 Cool, thank your for that hint. I used GetClass and SetClass to get the Class of the PIO and assign it to the polyline. May I ask another thing? I try to scale the symbol that is placed together with the polyline as a part of the custom PIO. I tried ScaleObjectN but it needs a constant (?) named 'const WorldPt&' as scale center. I do not know what that is? How can I define the scale center with just one value? http://developer.vectorworks.net/index.php?title=VCOM:VectorWorks:ISDK::ScaleObjectN VvierA Quote Link to comment
Miguel Barrera Posted October 15, 2012 Share Posted October 15, 2012 First, you are in the SDK C++ section and cannot use that function in VS. BTW, the parameter is a point with x,y,z values. You should be using HScale2D instead but have not tried it on a symbol. In the past, symbols could not be scaled in VS but maybe that has changed with the latest VW versions that allow scaling. Quote Link to comment
VvierA Posted October 16, 2012 Author Share Posted October 16, 2012 Thank you. I tried HScale2D but it doesn't scale the symbol. Maybe symbols could not be scaled yet (VW2012). 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.