News:

BB code in posts seems to be working again!
I haven't turned on every single tag, so please let me know if there are any that are used/needed but not activated.

Main Menu

Prompting for shape data on custom shape

Started by gooner, December 13, 2023, 03:03:27 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

gooner

I created a shape of a duct sensor. I made it out of rectangles. I then set a shape data field in each rectangle to display this value. I have it set to prompt when dropped onto the drawing. However when I grouped the object and place in on the drawing it does not prompt for the fields I am requesting. However even though it is grouped I can still select each field and select the data when its placed in my drawing. I have it set for fixed list. I tried to group them together initially but it would not let me select the fields individually when grouped. So I set the shape data to each individually then grouped the object and this is where i stand. How do I get the grouped shape to prompt when dropped? Thanks

Surrogate

Quote from: gooner on December 13, 2023, 03:03:27 PMHow do I get the grouped shape to prompt when dropped?

This checker must have this state!

gooner

#2
Here is how I have it set up. It works when I drop the rectangle itself on the page. But when grouped together no prompt. Here's the object t ogive you and idea what I'm doing.


Surrogate

Quote from: gooner on December 13, 2023, 03:46:25 PM
It works when I drop the rectangle itself on the page.
In your case you have Shape Data in sub-shapes, not in parent (group) shape?

hidden layer

Hi,
what Surrogate mean ist that the group (you created out of the rectangles) must have the data fields as well, and then the rectangles read from the group's fields and everything will be fine.


cheers
h

like this:l

Yacine


You may also consider putting the data in the group and display them on the sub-shapes.


http://visguy.com/vgforum/index.php?topic=6318.0
Yacine

gooner

I basically made some rectangles and added data graphic fields to each one. I then grouped them. Thanks for the responses so far!

vojo

and you can put alll the shapes in a groups and select the subshapes first

gooner

Yacine, i tried your method and it worked! Thanks a million!

gooner

I was incorrect, I get the data fields to show up but no prompt to enter data when dropped on the drawing. :-\

gooner

#10
I have tried two ways. Insert the fields individually to each objects then group. I tried the method in the video but i'm running Visio 2019 an of course all the menus are different. When I add the fields to the grouped object it just looks like this with the data just showing up in the middle like i thought it would. it does not let me relocate the data field when I insert. And it never prompts me for the data. About ready to just do this in AutoCad.. >:( Here is the correct shape showing how it looks.

wapperdude

#11
Actually, there's been good advice by all.  Here's the picture to go along with the discussion.

The process is
1) create your shape and group it together, let's say this is sheet.10 or whatevver 
2) with the top level group selected, add all the data properties that you want/need.  Make sure to check the Ask on Drop box.
3) for the group behavior property, set the group behind the member shapes.  That way you can select each.
4) now select each member, 1 at a time, and insert field or fields  This requires custom formula, something like sheet.10!Prop.Property1.  Do this for each property needed for the shape.  Do this for each shape that needs data.

That's it.  Place shape on your stencil.  When you drag and drop, you will be queried for each data entry! 

I did a quick, somewhat de-constructed example for better visiualization.  Just 1 data entry per shape => 3 for the group.  In this example, I drew a 4th shape and converted it group, but I don't recommend doing that for your more complex shape.

You can put AutoCad on hold.
Visio 2019 Pro

gooner

Quote from: wapperdude on December 14, 2023, 03:57:05 AM
Actually, there's been good advice by all.  Here's the picture to go along with the discussion.

The process is
1) create your shape and group it together, let's say this is sheet.10 or whatevver 
2) with the top level group selected, add all the data properties that you want/need.  Make sure to check the Ask on Drop box.
3) for the group behavior property, set the group behind the member shapes.  That way you can select each. (I searched in Visio help for group behavior policy and also googled it and get no results for group Policy in Visio. Not sure how to accomplish this)
4) now select each member, 1 at a time, and insert field or fields  This requires custom formula, something like sheet.10!Prop.Property1.  Do this for each property needed for the shape.  Do this for each shape that needs data.(How do I determine what the custom formula is? Where is the properties shown on the shape sheet? I have included a shape sheet for the group below.)

That's it.  Place shape on your stencil.  When you drag and drop, you will be queried for each data entry! 

I did a quick, somewhat de-constructed example for better visiualization.  Just 1 data entry per shape => 3 for the group.  In this example, I drew a 4th shape and converted it group, but I don't recommend doing that for your more complex shape.

You can put AutoCad on hold.

wapperdude

#13
I was assuming, my bad, that you had Developer mode activated.  To do so...https://learn.microsoft.com/en-us/office/client-developer/visio/run-in-developer-mode-display-the-developer-tab

Once that is done,  click the Developer tab in the GUI.  Then, with the Group top level shape selected, go to the Developer>Shape Design>Behavior.  From the popup window, 1) set: Selection => Members First (this more convenience, not required), and 2) set Group Data => Behind members.

Custom Formula:
The idea here is that drag and drop of a group from a stencil (or copy/paste), only attributes of the group are activated.  If it is desired for the members to be updated, then that has to happen vicariously thru the member shape.  Thus, all data entries that need updating upon drop must belong to the top level group.  Then, these values are either pushed into the respective member shape or the member shape pulls the info from the group.  Either way, it is necessary to know the ID of each shape involved.

ShapeID's:  In the GUI>Developer>Shape Design, select Shape Name.  If a shape is selected, the popup form will show its ID in the first entry.

Group Data:  the shape data entries proceed just like any other shape.

Group Push:
1) This is the most involved as it potentially requires many formulae in the group shape.  The basic syntax uses SETF/GETREF formula.  For each group data, there would also be, e.g., a corresponding User row entry.  That entry would then have a formula something like:  SETF(GetRef(sheet.#!User.Row),Prop.PropX)
  > the group will have multiple such formula in the User section which requires your setup. 
  > sheet.# is the sheet.ID of the target member shape
  > User.Row is the receiving spot in the target member shape.  You also have to create these.
  > Prop.PropX is the data entry of interest in the top level member shape.

That seems like a lot of work, but, it only has to be done once, per group.  Summary: 1) create shape data entries in group, create User entries in group to push values into members, 3) create receiving User Cell(s) in each member(s)

Member Pull:
This is a little less involved, as it doesn't, technically, need creation of receiving cells in the member.  Instead, the member shape merely displays the desired data values.  To do so, each member shape uses Field Insert entries.  The simplist implementation is a single insert for each data field to be displayed.  Each insert grabs the desired value from the top level member and inserts it into the member as text.  This is done with Custom Formula.  The syntax is:  sheet.#!Prop.PropertyName.
  ># is the ID value of the top member shape
  > PropertyName is the desired property in the top level shape.
  > a custom formula for each data property is required.

That's it.  As the group level data property values change, the new value gets pulled into the desired location(s) in the member shapes.  Much easier.

The attached picture depicts the features of the Member Pull process.

HTH
Visio 2019 Pro

gooner

Thanks for the detailed reply it was very helpful!!

Browser ID: smf (possibly_robot)
Templates: 4: index (default), Display (default), GenericControls (default), GenericControls (default).
Sub templates: 6: init, html_above, body_above, main, body_below, html_below.
Language files: 4: index+Modifications.english (default), Post.english (default), Editor.english (default), Drafts.english (default).
Style sheets: 4: index.css, attachments.css, jquery.sceditor.css, responsive.css.
Hooks called: 426 (show)
Files included: 34 - 1306KB. (show)
Memory used: 1261KB.
Tokens: post-login.
Cache hits: 14: 0.00136s for 26,766 bytes (show)
Cache misses: 3: (show)
Queries used: 15.

[Show Queries]