Jump to content
Developer Wiki and Function Reference Links ×

Drawing "Page Based" objects with Plug-In Object?


Arshan

Recommended Posts

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

Link to comment

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 by PatW
  • Like 1
Link to comment

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

Link to comment

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.

Link to comment
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)

Link to comment

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.

Link to comment

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 by PatW
Link to comment

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...