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

Shape question with no clue where to start looking.

Started by SwimBikeWalk, June 12, 2023, 03:06:19 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

SwimBikeWalk

The standard PID stencils are used in true process environments. The JCI ones (or similar copies) have become the de facto standard for HVAC processes. So they are the same but different, if that makes sense.

vojo

then why are you making new PID shapes?  addiing/changing control points?
it depends on how "slick" you want to get but you could
- take the PID shape
- group it
- add a control point on the group
-use partoloc functions to map (translate X,Y) to the PID shape geometry
-use guard function on PID control point so it does not change
-parent control point movement==>forces PID control point to move==>PID shape subassembly to move

Same premise as below (right click and shape data to personalize)

SwimBikeWalk

Vojo
Not making new shapes as much as tweaking what is already there.
The control point is broken. The Element/Probe should rotate around the text box with the control point but it just hides behind it now.
The other is cosmetic. I use the shapes in two different places, the PID page and the controller wiring page. On the pid page the probes could be longer to clean things up so they line up with other shapes. On the controller wiring page they could be shorter so I can space them out evenly and not have them slammed into each other.
The other reason is to learn how they work so I can make other SmartShapes in the future. Plus I would like to add more background functionality, mostly the ability to generate part numbers so I can automate a bill of materials. Something like pick a duct probe, then pick a probe from a list of only duct probes i.e. TS-1, TS-2, which would place the TS-1 in a tag field above the text box and kick out the part number 01DT-FER. The same would apply to emersion probes, or zone sensors etc. It's a big end goal but would save countless hours in the long run.

Wapperdude
Okay I've studied the info on the links you posted. I also dug through the shape sheet and looked at the stencil in the DEW and made a few shapes with sub shapes to get the feel of things.
I'd say I'm ready to jump back in!

Yacine

What you're describing is exactly what I developed myself for my P&ID needs.
You probably overlooked my last offer for help in your parallel topic, but the offer is valid.
Cheers,
Yacine
Yacine

wapperdude

#19
@SwimBikeWalk:  Ok.  We'll tackle the Control Point issue and fix the shape to behave as desired.

So that we're on same page and no clutter, start with a fresh document, with your stencil, and drop a single instance on drawing page.  If you haven't, enable Developer Mode.
.
> Open the DEW.  Expand the Foregnd page and then the drawing page. (Page-1)
>. On this page you should only see your placed shape.  Click-select it, and on the drawing window the shape will be selected, showing the infamous control point.
      >]. Open the Developer tab on the ribbon, and click on Shape Name in the Shape Design region.  A popup window will appear.  Note the value shown for ID..  We will use this later.  Hit cancel.
      >] now, back at DEW. 
> Your placed shape is a group expand it ( the + sign) and then expand Shapes
>. At this point you should see 2 objects: 
   B   >]  Rectangle and some shape, Sheet.xyz.  if you click-select Rectangle, you will see that it is selected on drawing page.
      >] Click-select Sheet.xyz in the DEW.  On drawing page the probe shape is selected.  It is a group shape.  We'll be digging into this. 
      >] in DEW, rt click Sheet.xyz and open shapesheet.  Herein is where the problem exists!!!
      >] in the Shape Transform Section,  neither PinX, PinY, nor Angle refer th the top level shape ID you noted above.   Plus the formulas, are whacky.  To make corrections to this shape...
          >>] in the Angle cell, enter:  Guard (IF(Sheet.abc!Scratch.X1=2,PI(), IF(Sheet.abc!Scratch.X1=3,-PI/2, IF(Sheet.abc!Scratch.X1=1,PI()/2, 0)))). Where abc is the top level ID noted from above.

          >>] in the PinX cell enter: Guard (IF(Sheet.abc!Scratch.X1=3,-Height/2, IF(Sheet.abc!Scratch.X1=1,Scratch.X1+Height/2,Scratch.X1/2)))

          >>] in the PinY cell enter: Guard (IF(Sheet.abc!Scratch.X1=2,Scratch.Y1+Height/2, IF(Sheet.abc!Scratch.X1=4,-Height/2,Scratch.Y1/2)))

What was corrected was the formula structure:  no OR function, add missing reference to top level shape for control point scratch calculation, corrected angle logic show placement follows control point location.

> note... expand Sheet.xyz and the shapes under it.  This shows all of the various probe subshapes.  The names, as they are, are not too beneficial, but this is also here that new subshapes probe types would be added.

Let me know how this goes.

Ed.  Corrected formulas, to show sheet.abc!  not sheet.xyz!
Visio 2019 Pro

SwimBikeWalk

@wapperdude

Thanks that worked like a charm!
Sorry it took a minute I created a new shape then broke every thing down to single if/else statements and observed what they did. I am a controls programmer after all Ha!
Then repeated the exercise several times before tackling the original problem, and now it works flawlessly.
I did add a user defined cell to reference instead of typing Sheet.1!Scratch.X1 every time.
I was also able to work out what they were trying to do with the original formula =ATAN2(Controls.Row_1.Y-LocPinY,Controls.Row_1-LocPinX)*180/PI()+180 they just had it in wrong, but talk about a long way around to accomplish something simple. Reminds me of a Johnson Controls programmer I know, why settle for simple when you can have pages of math.

Out of curiosity why PI() -PI()/2 and PI()/2 instead of 180 90 and 270? I tried using the degrees and it got weird just wondering why.

I'd say I'm now ready to take on the challenge of adding an additional probe, whenever you have a chance to do a bit more teaching.

SwimBikeWalk

@yacine

I'm afraid I did miss the offer. Thank you!
I will reach out for sure when I'm ready to dive into that level.

wapperdude

It's Sunday PM here.  So, maybe tomorrow, eh?

Again, we will take advantage of the DEW.  Once you get the hang of it, I imagine you'll want to go thru the existing probes and streamline their design. 
Visio 2019 Pro

wapperdude

#23
Ok.  Tighten your belt and pull up your boots, cause here we go.

I have gone thru this the task of adding a new probe...there are a lot of steps!!!  None are difficult, but there's a lot.  Hopefully, this will make sense, maybe not.

The task has 2 main parts:  drawing the new probe and integrating it into the group.  I'm going to assume you can handle the drawing task.   If not, we can go over it. 

Drag and drop existing probe object as before.  In the DEW, you should just see it.  There is some editing required, open its shapesheet.  NOTE its ID.  It will be used in last formula, substituted for abc.
  0) turn formula visibility on
  1) in the Shape Data section, edit the Prop.Type Format cell value.
        > add a name for your new shape to/at end of list...inside the dbl quote
  2) in the Actions section,
        > add a new row, something like Actions.Row_10.  Note, we will fix the ordering
        > in the Action cell, copy / paste from Row_8.  Edit the formula in Row_10 and change the 8 to a 10
        > in the Menu cell, enter the name of your new probe.  Enclose it in dbl quotes
        > in the Sort key column, starting with Row_1, sequentially enter 1 - 8 for each row.  For Row_9, enter a 10, and for Row_10, enter a 9.  This sets the displayed ordering in the right click context menu for the shape.
        > in the Checked cell, enter User.Type=6
        > all the remaining cells may be left blank, or set to No Formula
  3) close the shapesheet.

If you have a new probe, place it on the drawing page, or create it now.  Once the probe is completed, it's ready to get incorporated into the main object.
  1) expand the parent group in DEW.  There will be a Rectangle and the next subshape.
  2) select this shape in DEW.  (It contains all of the individual probe shapes.  The new probe gets added to these.)
  3) with the group still selected, press/hold shift key and select your new probe shape.  Both should be selected.
  4) align the 2 shapes such that new shape is centered on the group.
  5) with both still selected, then do add to group.  New probe is now a member of the family.
  6) the DEW should show it as a member along with original probe shapes.

Now to finish the integration.  In the DEW, expand the new  probe.  Must edit each member's shapesheet. So, one at a time, open shapesheet.  In the Geometry.NoShow cell, enter this formula:  =IF(Sheet.abc!User.Type=6,FALSE,TRUE)..  Note, Type = 6 should be the index placement in the previously edited type list.

Once all of these shapes are updated, the task is completed.
Visio 2019 Pro

wapperdude

QuoteOut of curiosity why PI() -PI()/2 and PI()/2 instead of 180 90 and 270? I tried using the degrees and it got weird just wondering why.
.

Visio default is radians.  You can use degrees, but you need to specify the unit, e.g., 27 deg, not 27.
Visio 2019 Pro

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: 349 (show)
Files included: 34 - 1306KB. (show)
Memory used: 1201KB.
Tokens: post-login.
Cache hits: 15: 0.00188s for 26,721 bytes (show)
Cache misses: 5: (show)
Queries used: 16.

[Show Queries]