How can I easily print multiple layers on multiple pages in Visio - printing

We've created a flow chart using Visio that has multiple layers. (The background is that each layer represents variations on a basic process.)
Now we want to be able to print each layer individually. Currently this involves lots of clicking to select the correct layer and and then press print - then repeating this for each of the 10 layers.
Is there a simpler way? E.g. define each layer once and use a "print each layer" tool / macro?

This is fairly easy through VBA. I tested it using the page export to jpeg, but the print should work as well. It just loops through all the layers in the active page, hiding every layer first, then unhiding the current looped layer, and prints.
Sub PrintLayers()
Dim CurrShowLayer As Visio.Layer, CurrLayer As Visio.Layer
For Each CurrShowLayer In ActivePage.Layers
For Each CurrLayer In ActivePage.Layers
CurrLayer.CellsC(visLayerVisible).Formula = "0"
Next CurrLayer
CurrShowLayer.CellsC(visLayerVisible).Formula = "1"
ActivePage.Print
Next CurrShowLayer
For Each CurrLayer In ActivePage.Layers
CurrLayer.CellsC(visLayerVisible).Formula = "1"
Next CurrLayer
End Sub

Related

How to always show Sirius Label in foreground

For the context, I'm working with Capella, an Eclipse RCP application based on Sirius (hence, EMF, GMF and draw2d). This application is used for MBSE, that basically means diagram representations for industrial systems.
I'm developping an add-on (viewpoint) to display custom labels next to diagram elements. These diagram elements are, to put it simply, boxes inside boxes. My problem is that usually the label text is larger than the space between a box and its container, so the label gets hidden. What I need is these labels to always be in foreground. As I'm more used to web development, what I'm looking for would be the equivalent of the z-index CSS property.
Currently I have no idea of how to achieve this, I'm using a custom .odesign that allows me to control some rendering options, like labels text, the color of some elements or to add decoration, but I dont think its the way to go for my problem. Maybe I should use a custom EditPart or a custom StyleConfiguration (I already used these components for other projects) but I have no clue where to start for this issue.
Any leads will be greatly appreciated.
We recently did this kind of changes to keep some labels in Sirius Sequence diagrams always on top: the combined fragments are placed behind the lifelines (z order) but we wanted to keep the labels of the CombinedFragments visible event their bounds intersects Lifelines, Executions or States).
This has been handled in Bug 564239 for Sirius 6.3.2 (used in Capella 1.4.1).
You could find some hints the bugzilla (Gerrits and commits can be retrieved from the See also section).
In Sirius Sequence diagram , we use org.eclipse.sirius.diagram.sequence.ui.tool.internal.layout.SequenceZOrderingRefresher to control the z-order of CombinedFragments : all the figures that composes them comes from some expressions in the odesign, and synchronization with the Capella model for exemple.
But in your case you want to control only the label, so it must not be dealt on the edit par level, but on the figure one. The "overlay" layer and figure lead might be a good one.
Do not forget another thing: in GMF/GEF, the labels of an element is displayed/shown/rendered/visible if it fits to the visible area of the parent container: in the case of a node in a container with scrollbar, the visible are will impact the visibility of the sub nodes (extended to their border nodes, edges, labels, ...)
Regards
Maxime

Is it possible to place a port on a layer so that it is invisible when the layer.visible is set to false?

Is it possible to place a port on a layer so that it is invisible when the layer is not visible?
I could not find an answer in GOJS documentation. I tested with this link template and it did not work.
myDiagram.linkTemplate =
$(CustomLink, // defined below
{ layerName: "blue",...
You can only put Parts in Layers -- either Nodes or Links or Adornments. In other words, you cannot split up a Node so that a piece of it appears in one layer and another piece of the same Node appears in a different layer.
The normal thing to do is to show or hide pieces such as ports, either by changing their visible property or their opacity property. The former causes the node's panels to be remeasured and rearranged; the latter does not. Several samples demonstrate this, including the Flow Chart sample.

Detect electronic circuit elements based on images

I'm trying to detect elements from an electonic circuit based on binary images. Therefore I have to separate it into parts. Each part should describe one element, e.g. a resistor or a capacity. I also want to detect branchpoints, where multiple line (or multiple elements) are connected.
The following picture shows an example circuit, which contains two resistors and two branch-points: Example Circuit with two resistors:
.
Thats what I want my program to detect automatically.
I already implemented an algorithm which is able to detect line segments and branchpoints, when the input-image contains lines with 1px linewidth.
The problem is transforming an image into this 1px linemodel. Some like this:
Does anyone know how to do it?
Thanks in advance!
Niklas
In Matlab you can use the following code
% Read image
I = double(imread('circit.png'));
I = I(:,:,1);
% Run thining opreation
IThin = bwmorph(~I,'thin',Inf);
% Show image
imshow(IThin)
And the resulted image is:

Change OpenLayers3 vector to edit via button

I have two vector polygons layers (ol3.2) and want users to switch between drawing and interacting with them via a button. I’d like the select and modify methods to work only for the active polygon layer. The documentation implies that the 'layers' option can be used to limit which layers can be selected, but I am not quite clear of the syntax. With task.myvector1 as the name of an ol.layer.Vector, I currently have:
select = new ol.interaction.Select({
layers: [ task.myvector1 ]
});
modify = new ol.interaction.Modify({
features: select.getFeatures()
});
But that does not successfully allow a selection, whereas when the option is removed select-and-modify works well, albeit for all layers.
Assuming this is just a syntax glitch, is there then a way to update the layers option in 'select', after a button click event, to switch the selectable layer to, for example, task.myvector2?

Corona SDK dynamic width objects

I'm trying to implement a game mechanics of "Hooking" objects... Here's picture of what i'm talking about:
But I have a problem with the chain/string of the hook.
I've tried create it step by step when the hook is on the fly, using timer and enterFrame events, but they both generate huge gaps between chain segments.
I've tried creating big image of whole chain and changing width dynamicly, but it only stretches and looking funny :D
Maybe anyone faced the same problem?
I would suggest you to try following.
Create whole chain
place it inside container (display.newContainer)
change width of container.
Container automatically generates masks so instead of stretching you will have just part of your chain hidden under mask.
here is link to container docs http://docs.coronalabs.com/daily/guide/graphics/container.html
This is not a complete answer - I have given you a bit of a broad answer to a broad question but I hope it can help you in creating what you need.
I created a very similar mechanic recently -
I used enterFrame to call a function, lets call it BuildHook, this would check the position of the hook and the position of the starting point and then calculate how many pieces of images would be needed to fill out the space. The graphic I had as my "hook" was partially larger then the chain pieces allowing for it to overlap and only put a new image once enough space between the last piece and hook was created.
This ment that it was the hook moving forward and backwards and then having a static "chain" between it and the starting point. Either consuming "links" as would move backwards ontop of them or created "links" as it moved away from them.
Keep in mind this is pseudo code but should give you an idea how to make it.
local arrayOfPieces = {}
local function BuildHook()
-- Bunch of variables you need to get
startX,startY,
hookX,hookY,
lastPieceX,lastPieceY,
singlePieceWidth
-- The hook pseudo code
if(hookX - lastPieceX >= singlePieceWidth) then
local newPiece = display.newImage('singlePiece.png');
newPiece.x = lastPieceX + singlePieceWidth/2
newPiece.y = lastPieceY
table.insert(arrayOfPieces,newPiece)
end
if(hookX < lastPieceX) then
lastPieceArrayPos = table.getn(arrayOfPieces)
table.remove(arrayOfPieces,lastPieceArrayPos)
lastPiece = arrayOfPieces[lastPieceArrayPos - 1]
end
end

Resources