I have built a simple conversion Add In, but its behavior is unfortunately different with the different Visio Editions (Visio 2010 Professional and Visio 2010 Premium).
The Add In takes a Process-Diagram created with Shapes from Stencil_1.vss and creates a new slightly different Process-Diagram with Shapes from Stencil_2.vsd. It loops through a Visio page and for each shape founded creates a new shapes from new master shape (from Stencil_2.vsd) and drop it into the new page. Geometry, captions etc. are the same, only the shape-appearance is changed. Below is the source diagram:
When I run the code into Visio 2010 Professional the swimlane shapes are drawn correctly.
When I run the same code from Visio Premium the swimlane appearance and layout are mismatched:
Both times i drop the SAME Shape("Swimlane" from the same stencil) into the Page with the SAME Code fragment:
Visio.Master vm = swimlane_stencil.Masters.get_ItemU(#"Swimlane");
Visio.Shape TargetShape = targetPage.Drop(vm, shape_x, shape_y);
How could I ensure, that the code produces any time the same (correct) output? Must I disable any (premium)features in the swimlane-shapesheet?
The cross-functional flowchart shapes are backed by an addon so that shapes get correctly positioned within swimlanes and the page etc. Most shapes have an on drop event that calls out to the addon for their respective functionality.
By the looks of it the addon isn't being invoked correctly in your Visio Premium instance. For example, there's a function in the EventDrop cell:
=RUNADDONWARGS("CFF14","/cmd=20001")
..where CFF14 is the 2010 version of the cross-functional flowchart addon.
Bear in mind that 2010 also uses container shapes within the cross-functional flowchart solution. Are you using the correct 2010 'target' shapes?
There should be no difference in functionality, as far as the cross-functional flowchart is concerned, between Professional and Premium editions as far as I'm aware.
thank you for your time!
Bear in mind that 2010 also uses container shapes within the
cross-functional flowchart solution. Are you using the correct 2010
'target' shapes?
The ‘target’ shapes in both cases are the Swimlanes from the cross functional flowchart stencil.
I tested the same Add In-code on another "Professional"-Machine, it was successful, I mean the "Swimlane" shapes are positioned correct and without separators and Title-section.
I also uninstall and install again the Premium instance and nothing is changed, the same code produces the same diagram drawn above. Swimlanes PinX are changed and separators and title-section are added.
I noticed, that in the “wrong diagrams” only the first dropped
Swimlane shape is correct
The following(later dropped) Swimlanes are wrong positioned and separators and title-bar are added. They have:
User.msvShapeCategories="CFF Container;DoNotContain", the right Swimlane-shapes have: User.msvShapeCategories="Swimlane;DoNotContain"
Also I noticed, that the wrong Swimlanes are derived
from xfunc_m.vss ( User.visMasterStencil = "xfunc_m.vss")
I remove the value “xfunc_m.vss” from the User.visMasterStencil Cell
and update the stencil
Now it works fine, I hope this explanation is useful for others and somebody could explain this behavior better than me :)
Related
Recently i've been working on this repository https://github.com/xiaodongliang/forgeviewer_embed_in_powerbi_report to build a custom visual in Power BI to visualize the issues extracted from Bim track'S API.
The idea was visualizing them in associaton to the model's ROOMS.
In order to do that I worked with a NWC file, so i cuold export rooms as a geometry.
What i would like to do now is to highligt the rooms if a connected issue is selected from a table.
The problem is When i select an issue from a table, in the selection tree i can see highlighted the parent object name (ROOM) instead of the child (solid), and i think that is why i can't achieve my purpose (if not please correct me).
what i have
what i wold like to do
Does anyone know a way to do that?
If you would like to change your selection between (FIRST_OBJECT, LAST_OBJECT, LEAF_OBJECT) you can change viewer selection settings in order to test:
If you would like to achieve this programmatically :
Viewer.setSelectionMode();
could help you as well.
If I well understood, you want to highlight the child (which contain the mesh) instead of the parent.
The object highlight (isolate) is done in /forgePowerbiView/src/visual.ts with this code:
const dbIds = options.dataViews[0].table.rows.map(r =>
<number>r[0].valueOf());
console.log('dbIds: ' +dbIds)
this.forge_viewer.showAll();
this.forge_viewer.impl.setGhostingBrightness(true); //for isolate effect
this.forge_viewer.isolate(dbIds);
Take a look at this link Enumerating leaf nodes on Viewer. This will help you to get the dbIds you want to isolate.
I need to create a Visio document and add shapes from a .vss file. I am able to add simple shapes and add text to it without any issues. But I am having issues when I am trying to add a shape which is a collection of 4 rectangles grouped together (I believe it's called a master) and add texts to each shape.
I want to populate values (add texts) in each of these rectangle shapes in the group. Once I drop this master into the Visio page, it's appearing as a group. I am able to ungroup each rectangle with the Ungroup() method. But I don't know how to get each individual element from this group. Is there a way I can uniquely identify each element in this group? Or iterate through the group and find each element? Please see the code below, what I did so far.
Visio.Document doc = application.Documents.Add(#"\example.vst");
Visio.Page page = application.Documents[1].Pages[1];
Visio.Documents vdocs = application.Documents;
Visio.Document visioStencil = vdocs.OpenEx(#"\sample.vss", (short)Microsoft.Office.Interop.Visio.VisOpenSaveArgs.visOpenDocked);
Visio.Page visioPage = application.ActivePage;
Visio.Shapes visShapes = visioPage.Shapes;
//the following shape in the setensil is the group of 4 rectanle I was referring
Visio.Master visioConvMaster = visioStencil.Masters.get_ItemU(#"Conveyance");
Visio.Shape visioConvShape = visioPage.Drop(visioConvMaster, 4.25, 5.5);
//try to ungroup to get each
visioConvShape.Ungroup();
Any idea how I should proceed further? I am really new to Microsoft technologies. I am using Visual Studio 2012 professional & Visio 2010 Premium.
Thanks in advance.
Visio.Shape objects have a property "Shapes", which is a collection of child shapes. Don't ungroup; first, iterate through the Shapes collection (visioConvShape.Shapes[0], visioConvShape.Shapes[1], etc.) and then if you need to ungroup, do so after you have either at least performed whatever action you need to or identified them and/or given them reusable names.
I am just starting out with dynatree (which is indeed v. cool), but I have a non-standard use for it: sorting terms from a long list into the hierarchical Dynatree. Specifically, I want to drag-and-drop from outside the Dynatree onto a Dynatree element--preferably exploiting Dynatree's spring-loaded folders rather than expecting the user to manually open the relevant categories beforehand.
Could I get some specific guidance on how to achieve my dreams?
Thanks,
Steve Upstill
One of he drag'n'drop samples seems to implement your use case:
You can drag the 'Drag me around' box over the right tree.
http://wwwendt.de/tech/dynatree/doc/sample-dnd3.html
The box is a simple query.draggable.
The tree receives the standard events (onDragEnter, onDragOver, onDrop, onDragLeave).
Make sure to enable the autoExpandMS option.
Hope this helps
Martin
I'm trying to implement an application that is able to paint Visio shapes (that are read from Visio XML files). My problem is that Visio typically uses the internal functions _ELLIPSE_ECC and _ELLIPSE_THETA for the C and D cells of EllipticalArcTo. In the MSDN Visio SDK doc, I found only the following information (http://msdn.microsoft.com/en-us/library/ff767234.aspx):
Certain functions appear in formulas generated by Visio, but are not
listed in the Insert Function dialog box or described in this
reference because they are reserved for internal use and should not be
used in other formulas. Following are examples: ELLIPSE_THETA,
_ELLIPSE_ECC, _UCON_C1, and _SHAPEMIN.
I tried to use the pre-calculated value from the file instead of the formula but that works only well if the aspect ratio of a shape is not changed.
Does anybody know there to find more information about these functions?
Check out this thread at Visio Guy's forum.
http://visguy.com/vgforum/index.php?topic=880.msg3907#msg3907
The Visio Guy forum is run by Microsoft Visio MVP Chris Roth who was one of the original shape masters at Visio Corporation.
I have to create a table in my wizard page and I want to create it using TableViewer. I'm using WindowBuilderPro for designing my wizard page. The TableViewer control is available in the palette of WindowBuilderPro but I'm not getting how to use it properly.
Has any body used the same?
Thanks a lot in advance!!
You have two ways of filling the TableViewer with contents (similar to TableViewers in JFace):
You can define a content provider and a label provider manually. A content provider has to return a set of Objects, that represent each line of the table; while the TableLabelProvider translates the returned objects to texts in the columns. The content and label providers are to set in the Properties box on the left. In this case, the resulting code should look like the following snippets: http://wiki.eclipse.org/JFaceSnippets#Snippet001TableViewer or http://wiki.eclipse.org/JFaceSnippets#Snippet007FullSelection.
On the other hand you could define JFace Data Bindings to fill the table with contents. In this case you have to define a corresponding binding, that returns the list of all contents; additionally you have to create a label provider, that works similar to the previous one.
There is also a way to fill the table content using a newer API then supported directly by WindowBuilder: you could create TableViewerColumns, and ColumnLabelProviders for each column, thus resulting in much nicer code for Label Providers (and also this API is newer, so it should be preferred for new JFace based code) - but in this case you have to create your code manually. See the JFace Table tutorial from Lars Vogel.
Additionally, if you don't know the JFace Viewer framework from before, I suggest reading the first few questions listed in the JFace FAQ to gain a better understanding of the ideas (and the tutorial from Lars Vogel is also nice for this reason).