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 Connection Info

Started by jimibray, September 08, 2020, 01:29:26 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Surrogate

James, can you attach there your document ?
If yes, delete all confidential and meaningfull information ! Just few shapes and connectors between them

jimibray

Hi Surrogate,

Hopefully this attachment uploads  :)

Surrogate

#17
in your example cell have formula Prop.Conn&"-"&Prop.Ref_Des, which contain concatenation
when your macro try get it formula and set to other shape's cell it convert to string (not formula).

in cell Prop.ConX always use formula "Prop.Conn&"-"&Prop.Ref_Des" ?

jimibray

Prop.Conx is always this formula
=Prop.Conn&"-"&Prop.Ref_Des

In the wire shape it needs to reference Prop.Conx of the shapes it's connected to in the Prop.To and Prop.From cells.

Ultimately I'd like to run a shape report on the wires and generate a wire list

Wire IDFromTo
Prop.Ref_DesProp.FromProp.To




Surrogate

IMHO You can get (read) property as string from cell User.Conx ! Where is these sub-strings are concatenated.
                        If EP.FromPart = visBegin Then
                            ' Get shape this end is attached to
                            Set shpFrom = EP.ToSheet
                            ' Pull Prop into shape
                            shp.CellsU("Prop.From").FormulaU = shpFrom.CellsU("User.Conx").ResultStr("")
                        Else
                            ' Get shape this end is attached to
                            Set shpTo = EP.ToSheet
                            ' Pull Prop into shape
                            shp.CellsU("Prop.To").FormulaU = shpTo.CellsU("User.Conx").ResultStr("")
                        End If
                    Next

But if you change some connections, values in Prop.To/Prop.From don't updated.

Surrogate

                    For i = 1 To cnxEndPoints.Count
                        Set EP = cnxEndPoints(i)
                        If EP.FromPart = visBegin Then
                            ' Get shape this end is attached to
                            Set shpFrom = EP.ToSheet
                            ' Pull Prop into shape
                             ' in next line of code you define shpFrom and create reference to prop.conx property of this shape !
                            shp.CellsU("Prop.From").FormulaU = "sheet." & shpFrom.ID & "!prop.Conx"
                        Else
                            ' Get shape this end is attached to
                            Set shpTo = EP.ToSheet
                            ' Pull Prop into shape
                            ' in next line you define  shpTo and create reference to prop.conx property of this shape !
                            shp.CellsU("Prop.To").FormulaU = "sheet." & shpTo.ID & "!prop.Conx"
                        End If
                    Next

jimibray

Hi Surrogate,

The second block of code you posted is working perfectly :) if I change the connectivity in the diagram and re-run the macro it updates the connectivity!

Thanks so much for helping, you're a hero!!!

-James

Surrogate

#22
James, thank you !
But i rarely use automation with connectors, in Russian forum our member share own repository
https://github.com/gtfox/SAPR_ASU
With great automation like this

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: 292 (show)
Files included: 34 - 1306KB. (show)
Memory used: 1132KB.
Tokens: post-login.
Cache hits: 13: 0.00164s for 26,757 bytes (show)
Cache misses: 3: (show)
Queries used: 16.

[Show Queries]