Arshan Posted November 15, 2018 Share Posted November 15, 2018 Hi All, I'm writing a Plug-In Object that I'm using to draw some annotating labels. Is there a way to have the Plug-In draw objects using "Page Based" units? I know a fixed symbol can be defined as Page Based or World Based. Is there a way to do something similar with objects drawn by a Plug-In? -Arshan Quote Link to comment
PatW Posted November 15, 2018 Share Posted November 15, 2018 (edited) If you want to Draw the object in absolut scale (always the same size on the print) you simply need to consider the layer scale: mmVW = absoluteMM * layerScale; To convert the Millimeters in the drawing unit you can use: VS:GetUnits fractionLONGINTApproximate WorldCoords per drawing unit. Use GetPrefReal(150) instead. Edited November 15, 2018 by PatW 1 Quote Link to comment
Arshan Posted November 15, 2018 Author Share Posted November 15, 2018 Thanks PatW! I was wondering if there was some kind of flag to force "page" units in the script, but this should work fine! Quote Link to comment
_c_ Posted November 18, 2018 Share Posted November 18, 2018 No, sorry Arshan, that can't go well. What happens when you display in Viewport with another layer scale? Nothing. Wrong display since the object won't regen. And anyway you would need an event enabled plug-in with regen on layer scale change also for a correct display on design layer. Otherwise there will be no conversion. kObjXPropHasLayerScaleDeps = 2; { Object wants to be reset with when its layer scale changes. // Boolean Property } Did you actually try to use the symbol flag on your Pio? It might work. /SDKLib/Include/Kernel/MiniCadCallBacks.h const short ovSymDefPageBased = 130; // Boolean - whether the symbol will have a constant page size, meaning it will have the same size Quote Link to comment
Arshan Posted November 19, 2018 Author Share Posted November 19, 2018 Thanks for this, Orso. I did already setup the Layer Scale Dependency for design layer changes, but you are correct that Viewports still cause a problem! Hadn't tested that yet until you mentioned it! I'd like to try setting the Page Based symbol flag you mention, but how would I do that? I'm unclear on what function call I can use to try to set that flag. Quote Link to comment
PatW Posted November 19, 2018 Share Posted November 19, 2018 On 11/18/2018 at 8:12 AM, orso b. schmid said: No, sorry Arshan, that can't go well. What happens when you display in Viewport with another layer scale? Nothing. Wrong display since the object won't regen. But absolute Symbols seem also not to care about ViewPorts. So maybe it will behave the same with the ObjectFlag. 12 hours ago, Arshan said: I'd like to try setting the Page Based symbol flag you mention, but how would I do that? I'm unclear on what function call I can use to try to set that flag. Have you tried: vs.SetObjectVariableBoolean(h, index, status) Quote Link to comment
Arshan Posted November 19, 2018 Author Share Posted November 19, 2018 Thanks, PatW. I tried using vs.SetObjectVariableBoolean(h, index, status) and it doesn't seem to do anything. I double checked the function call by targeting a PIO specific object variable instead which worked, so it looks like the Symbol Page Based flag can't be applied to the PIO. Also, by the way - in my tests, page-based symbols did take viewport scale into account. ie. they would size themselves based page-based units on a sheet layer even when viewed through a viewport with a non-1:1 scale. Quote Link to comment
PatW Posted November 19, 2018 Share Posted November 19, 2018 (edited) As a test I created a WorldBased and a PageBased Symbol next to each other. When the Design-Layerscale is changed the size relations of the two symbols change as expected. (At some scale Smybol A is bigger at another Symbol B is bigger.) But when this syms are both in the viewport and I changed the Viewport layerscale the whole scene simply gets bigger or smaller and the relations stays the same. So in this case the PageBasedSym is not behaving different. Maybe you meant something else. Edited November 19, 2018 by PatW Quote Link to comment
Arshan Posted November 19, 2018 Author Share Posted November 19, 2018 Odd - I just performed the same test and have the viewport version scale the same as the design layer version (ie. in the scaled viewport the world and page-based symbols appear different sizes) 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.