Jump to content
Arshan

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

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

Share this post


Link to post

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

Share this post


Link to post

Thanks PatW!

 

I was wondering if there was some kind of flag to force "page" units in the script, but this should work fine!

Share this post


Link to post

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

Share this post


Link to post

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.

Share this post


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

Share this post


Link to post

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.

Share this post


Link to post

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

Share this post


Link to post

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)

Share this post


Link to post

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.


 

7150 Riverwood Drive, Columbia, Maryland 21046, USA   |   Contact Us:   410-290-5114

 

© 2018 Vectorworks, Inc. All Rights Reserved. Vectorworks, Inc. is part of the Nemetschek Group.

×
×
  • Create New...