Jump to content

Worksheet Current Layer Criteria


Recommended Posts

Hello,

 

There is any way to have a Current Layer Criteria in a Data Worksheet?

 

The objective is to get Data (ex:floor area) from the same Layer where the Data Worksheet is inserted , whitout need to insert the name of the layer in the criteria.

This will aloud to get data from a specific layer (excluding all the other layers)  just dropping the worksheet on the target layer.

 

thank you in advance from any input>

Link to comment

Not really.  Because you can insert the same worksheet on any or every layer.  Vectorworks sort of treats worksheets like symbols in a way.  There is a worksheet resource that lives in the resource manager and there are as many images of that worksheet as you want.  Any change you make to one of the worksheets "images" you make to all of them.  So you will need to make one worksheet, then duplicate it in the resource manager and drop the new worksheet to the layer you want.

 

You CAN short cut the process a little bit by setting the database criteria to call the layer name from a cell in the worksheet.  I'll attach an example.

Worksheet Layer Criteria Example.vwx

Link to comment

Dear @michaelkthank you for your feedback.

 

yes, this could do the trick. Could you just help me on this doubts:

 

1- How can i edit the Criteria? It indicates that need to be edit worksheet formula bar. Where is this?

 

2 - This criteria Shearch for rectangles in the specific Layer. What would be the Criteria to search in a specific Layer, geometry with Specific Record Data attached?

 

thank you for your help

image.png

Link to comment

Nuno

 

You're almost there!

 

Set it up the criteria up the normal way to look on one layer for polygons with the desired record attached.  Hit OK.

 

Now go back to edit the criteria.  Hit Cancel.  In the formula bar you will see something like =DATABASE(((L='Layer Name') & (T=POLY) & (R IN ['Record Name'])))

 

Delete 'Layer Name' and replace it with the cell you want to use as the layer name by clicking on that cell.

 

Once you do that, you can type any layer name into that cell and change the criteria for the database.

 

Let me know if that isn't clear.  :-)

 

 

Edit:  In the example you showed on the screen shot, just hit OK and change make whatever changes you want in the formula bar.  However, you may find it easier to use the GUI to set the criteria first for one specific layer and then edit to change the layer name to a cell reference.

Link to comment

Gentlemen,

Here's a small file with a custom WS function that returns the active layer name to the cell it's placed into. It should simplify having to type the layer name in manually. If you change a layer's name, the function adjusts automatically when the WS is recalculated.

 

If you're like me, and you sometimes use a worksheet to gather info without placing it on the drawing, then all you need to do is change the Active Layer, open the WS resource, and recalculate to get stats from the current active layer. You'll only need one WS resource for this kind of use.

 

If you want to place a WS instance on multiple layers, then the way Michael set it up in his example file (with 1 WS resource for each layer) will work, but you if use the ActiveLyr function from my example you won't have to type the Layer Name into each WS resource. 

 

HTH,

Raymond

WS ActiveLyr.vwx

Link to comment
  • 1 year later...

Sorry for may late reply

 

I'm to busy doing the daily work, than it not leave many space to the improves.

 

I want to thank you both for your great feedback. I want to create a mix of your both ideas, but I stoped (probably in a very basic step)

 

@MullinRJ your file works great when I open, if I change the name of the Layer it automatically updates, but when I copy your worksheet to my file, the result turns 0

 

I have to active any specific script in my file? I notice this CCC window open in your file with the runscript (attached image). Could you help me in this little step?

 

Thank you again for your help.

 

Best regards, Nuno 422496669_RunScript.thumb.png.722f2dd8d75b604809135b64d658ac55.png

 

Link to comment

Hi Nuno,

   The worksheet uses a custom function (or a user defined function) to supply the name of the active layer and that is the VectorScript "ActiveLyr" you see in the "ccc" script palette of my original file. So, you also have to copy the VectorScript "ActiveLyr" to your file for the worksheet to work properly. You may copy it into one of your script palettes, or import the "ccc" resource (script palette) to your file and the "ActiveLyr" vectorscript will come with it. You never run this script directly, you only call it from within a worksheet, but it does have to be in your file for the worksheet to function, the way I've set it up.

 

   I probably should have named the "ccc" script palette "Wks Scripts". That might have made it more obvious you needed it in your working file, too. 

 

   If you still have questions, please write back before September 2019 and you should get a pretty prompt answer.   :-p

 

HTH,

Raymond

Link to comment

Thanks a LOT (you work on Sunday!!!!) 😉

 

Now it works PERFECTLY 

 

I may have an additional question regarding Worksheets.

 

There is any solution built in on VECTORWORKS for workflow problem:

 

Project DATA info update in ALL PROJECT FILES and LAYOUTS.

 

For each project in our office we have about 5 vectorworks files and each one with several sheets layouts. There is any way that we can centralize the Project DATA info (name, address, client, date, stage, etc) in a common external file (as an xRef) and easily Change/Update this information and imedeatly populate all the linked files and layouts (without manual imports or worksheet updates - just with the open of the file)?

 

Thank you in advance and have a NICE Sunday (I'm in a GreeK Island (Milos) by the way in holidays)

 

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...