Generate Layer via Shapesheet

Started by wabright, July 17, 2015, 12:30:28 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

wabright

Hey everyone, I am trying to create revision bubbles for engineering drawings that I can assign to a layer based upon what revision they are (Rev_1, Rev_2, etc).  I created a shape that based upon the number entered, it assigns it to the proper layer.  The problem is when I drag the shape from the stencil (attached) onto the page, I am only getting the current layer of the shape to transfer from the stencil to the page.  So the formula which is setting the layer is lost, along with all layers associated the the shape's page.  Is there a way to transfer the layers with the shape?  Or is there a way to create a layer via the action menu of the shapesheet?  That way if I entered a "2" it would auto-create a "Revision_2" layer on the drawing page?  Perhaps my answer is VBA assigned to the shape.  Note that I have already wrote a macro that allows the user to enter text into a pop-up textbox (e.g. Revision_1) and it goes through all the sheets of the drawing and finds any layer called Revision_1 and hides the layer. 

Thanks for the help!

Thomas Winkel

Hi,

in order to transfer the revision layers to your page you have to assign the master initially to all layers.
You can restore the lost formula with a =SETF(GetRef(LayerMember),"GUARD(User.ShapeText)") in EventDrop.

Anyhow, I would do the job with VBA in the stencil.
You can run the code from the shapesheet using CALLTHIS:
CALLTHIS("ThisDocument.doSomething","MyProject")
You can trigger the code from the event cells, the action cell, or using DEPENDSON.

Regards,
Thomas

wabright

Thomas,

I took your suggestion and did it in VBA. The only way I could make it work well was to trigger the event based on when the text changes (thetext cell).  If the user types a 2, but meant to do a 3, then you end up with an empty Revision_2 layer because the macro runs on every keystroke, but otherwise it works flawlessly.  Thanks for your suggestions.
Wally