Welcome to MSDN Blogs Sign in | Join | Help

Visio: Preparing for a new VisioAutomation Release

I’ve been deliberately keeping quiet about some of my latest Visio work, but I wanted to shed a little light before my latest code is available in “beta” form. In summary, I released VisioAutomation 1.0 (ver 1.1.1) in early 2009, but since then I’ve been significantly updating the code for for a 2.0 release very soon.

Key updates:

  • Scripting
    • Much better support for scripting Visio via IronPython - The “VisioInteractive” command shell has seen some significant improvements and feature additions
    • PSVisio – major enhancements to Powershell via PSVisio –which is a Powershell 2.0 module
      • A simple example of a Powershell script
        • PS> import-module .\PSVisio.Dll
        • PS> New-Visio
        • PS> New-Document
        • PS> Draw-Rectangle 1 1 3 4
        • PS> Set-Fill –FgColor -0xff0000
    • Both VisioInterative and PSVisio go through a simple scripting layer called VisioAutomation.Scripting – so they share the same code. But, before I release 2.0 I am exploring Having VisioInterative also go through the Powershell cmdlets.
  • Many more Unit Tests & Demos
  • Visio Power Tools Add-In
  • Core Automation Library
    • It’s become much simpler – in the sense that it does no “wrapping” of Visio’s automation.
    • The higher-level convenience code for building tools and scripting has moved to the Scripting layer
  • New source location
  • x64 compatibility
    • After moving my dev workstations to Windows 7 x64 I discovered a couple of implicit dependencies on x86 Systems. Those dependencies have been replaced so everything will work on both platforms.

As soon as Windows 7 RTMs I’ll post the but until, but until then you can download the source.

Posted by saveenr | 0 Comments

Pixels: My screen capture tool now on CodePlex

A follow-up from yesterday’s post: My own custom Screen Capture application for Windows – I’ve created a project on CodePlex to host the tool.

 

The source code is now at this location on CodePlex: http://isotopescreencapture.codeplex.com/

You can still get the binaries from my SkyDrive: http://cid-19ec39cb500669d8.skydrive.live.com/browse.aspx/Public/Tools/Isotope-Screen-Capture

Posted by saveenr | 0 Comments

Pixels: My own custom Screen Capture application for Windows

I’ve blogged about screen capture applications before ( my recommendations for 2009 , and this was the topic of my very first blog post in 2005). Today I’m making available a small side project I’ve been working on: “Isotope Screen Capture” – a very small, opinionated tool for windows which captures the entire desktops.

 

image image

WHERE TO GET IT?

Binaries are here on my SkyDrive

http://cid-19ec39cb500669d8.skydrive.live.com/browse.aspx/Public/Tools/Isotope-Screen-Capture

 

Source Code is at the CodePlex project

http://isotopescreencapture.codeplex.com/

 

WHAT MAKES IT DIFFERENT?

  • the vision for this app is simplicity
    • make it simple to take screenshots
    • make it simple find the screenshots you’ve taken
    • don’t ask the user any questions
  • It’s free and the source code is available
  • It’s heavily optimized (opinionated) for a specific screenshot scenario that involves taking large numbers of screenshots – as if one were trying to document a click-by-click walkthrough (as I do with many of my blog posts)
  • That optimization means that features available in other apps for the end-user to customize how the app works deliberately don’t exist in this tool – the lack of choice makes this a much simpler and more reliable tool

WHAT OPINIONS DOES IT EXPRESS?

  • Screen capture must be a lossless recording – for this reason the files are always saved in PNG format and there are no options that alter the output in any way (scaling, sharpening, etc)
  • Ever taken a screenshot but lost it? This tool doesn’t ask whether you want to save the screenshot or not. It will always be saved.
  • The users “My Pictures” folder is the right place to store images – letting the user pick a location will eventually result in images that are lost
  • There’s exactly one hotkey the app will use: PRINTSCREEN.
  • The mouse is on the screen – it’s going to get captured. if you don’t want it to be seen, move the mouse toward the edge of the screen.
  • filenames must be meaningful – they will reveal exactly when the screenshot was taken and the dimensions of the image. For example “screenshot(2009-06-21_12-53-41)_(2560x1600).png”.

FUTURE WORK

  • I haven’t tried this out in a multi-monitor scenario. But it should will always capture primary screen.
  • Move to a WPF-based interface.

PARTING THOUGHTS

  • Please try it out. I welcome your feedback.
  • Move to a WPF-based interface.
Posted by saveenr | 1 Comments

Mounting ISO images as a drives on Windows

This week I wanted to try the Windows Automated Installation Kit (AIK) for Windows 7 RC in order to play with the new feature that allows you to boot from VHD files. After I downloaded the WAIK I hit my first stumbling block - it’s distributed as an ISO file

image

I didn’t want to use a DVD-R just for installing the WAIK so I went on the hunt for a tool to mount the ISO as a drive and found a small, very easy-to-use, and free tool: Pismo Technic’s Pismo File Mount Audit Package.

Despite its unexciting name, this is a very convenient tool to have (did I mention it is free?)

 

SCREENSHOTS

image

 

image

image

Posted by saveenr | 4 Comments

Scripting: Reliably Finding my 32bit EXEs on a 32bit & 64bit OS or Where is IronPython?

Having enough of not being able to use that last 1GB of the 4GB physically available on my machines, I used the recent release of the Windows 7 Release Candidate to move into the world of 64 bit computing. As a typical end-user the transition has been seamless. All the applications I use on a day-to-day basis “just work”. As someone who writes code and scripts, I’m still finding some friction. Nothing too difficult to overcome, but it is part of the learning that comes with any platform change.

This week’s adventure started off with IronPython. I have a script called start_ipy.cmd. All it does is launch the IronPython shell (IPY.EXE) with some options to turn on color in the shell and enable tab completion.

The script looks like this:

“%PROGRAMFILES%\IronPython 2.0.1\IPY.EXE” -D -X:TabCompletion -X:ColorfulConsole

Which of course works great on my 32 bit Windows machines And which fails to find IPY.EXE on my 64bit machines. That is to be expected, IronPython is installed under “Program Files (x86)” which is the location found in the PROGRAMFILES(x86) environment variable. So fixed my script to read something like this

“%PROGRAMFILES(x86)%\IronPython 2.0.1\IPY.EXE” -D -X:TabCompletion -X:ColorfulConsole

And it worked great on my 64 bit machines. But it failed on my 32-bit machines. Why? Because the PROGRAMFILES(x86) is only defined by default on 64bit OSes.  So the result of this is the script could find the IPY.EXE on either 32bit or 64 bit OSes both not both.

 

Also curiously, there is no environment variable called PROGRAMFILES(x64) that points to the specific location of 64 bit applications.

So let’s look at the situation in a table…

 

Environment variable Exists on 32 bit Windows Exists on 64 bit Windows
PROGRAMFILES YES – points to 32 bit apps YES – points to 64 bit apps
PROGRAMFILES(x86) NO – but I want it to exist YES – points to 32 bit apps
PROGRAMFILES(x64) NO – and it does not make sense to exist. NO – but I want it to exist

 

What wanted was simple: 2 things

  • PROGRAMFILES(x86) to point to the location of 32 bit apps on both 64bit and 32bit Operating Systems. This would solve my initial problem
  • PROGRAMFILES(x64) to point to the location of 64 bit apps on 64bit OSes. This is just for completeness – it doesn’t have any relation to my original problem

Fortunately it’s not hard to compensate for this, a few extra commands in the script gives everything I need

IF DEFINED ProgramFiles(x86) SET ProgramFiles(x64)=%ProgramFiles%
IF NOT DEFINED ProgramFiles(x86) SET ProgramFiles(x86)=%ProgramFiles%
“%PROGRAMFILES(x86)%\IronPython 2.0.1\IPY.EXE” -D -X:TabCompletion -X:ColorfulConsole

Now I have a reliable (for my purposes) way of finding 32 bit apps on a Windows machine that “does the right thing” on either 32bit or 64bit operating systems and, more specifically, I am now have coloring and tab completion for IronPython on all my machines.

 

FINAL THOUGHTS

  • The script doesn’t check whether the locations actually exist, but rather what the paths “should” be
  • I’m far for a Windows shell scripting expert, if you have alternative techniques, please share
Posted by saveenr | 1 Comments

Typing Polish Accented Characters on a US Keyboard

I’m learning to speak Polish. As someone who enjoys learning challenges I certainly found one in this wonderful language. (And any language that calls November “Listopad” has got to be interesting.)

 

Generally I create my own study materials whenever I study something intensely and that’s where I hit my first stumbling block – how to I type in the Polish accented characters on a US Keyboard:

ą Ą ć Ć ę Ę ł Ł ń Ń ó Ó ś Ś ż Ż ź Ź

 

There are a couple of alternatives available to you:

  • Use a Polish Keyboard layout with your US Keyboard – creates shortcuts that apply to all applications running windows
  • Use a Word Document that has specific keyboard shortcuts assigned to generate the characters – these shortcuts only apply to the word document.

Both techniques are describes below

 

POLISH KEYBOARD LAYOUT WITH A US KEYBOARD

 

image

 

HOW TO ENABLE ON WINDOWS 7

Launch control Panel

snap0061

 

The Control Panel will launch

snap0062

 

In the upper right type “keyboard” to search for the keyboard-related control panel items

snap0063

 

Under Region and Language click change keyboards or other input methods

 

snap0064

 

The Region and Language dialog launches.

Click change keyboards.

 

snap0065

The Text Services and Input Languages dialog will launch

snap0066

Click Add

snap0067

The Add Input Language dialog launches

Find the node that says “Polish (Poland)” and click on the [+] to expand the node

snap0072

Expand the Keyboard node

snap0073

Check the “Polish (Programmers)” item

  snap0077

Click OK

snap0078

 

Back at the Text Services and Input Languages dialog, click the drop down for the Default Input Language

snap0079

Select the polish keyboard you added

snap0080

 

Click OK

snap0081

 

Click OK

snap0082

 

Close the Control Panel

 

 snap0083

Now test it out. Launch Notepad and start typing

snap0089

WORD DOCUMENT WITH SHORTCUT KEYS

Unlike German, for which when using a US Keyboard Microsoft Word has out-of-the-box keyboard shortcuts to help you type German characters (for example ë and ß), this doesn’t isn’t immediately possible with a default document in Microsoft Word 2007. One character (Ó) is available but the rest are not.

Fortunately, by using the Insert Symbol feature you can also assign your own keyboard shortcuts. So, for those who are starting to learn this language I’ve made a sample doc available on my SkyDrive, that comes pre-built with the shortcuts.  The diagram below (also present in the doc) in the doc shows how to generate the characters.

image

 

HOW TO USE

Posted by saveenr | 4 Comments

Visio: Conference Schedule Sample

As a very distributed engineering organization, our teams in Dynamics AX periodically schedule “workshops” that bring team members from our sites worldwide to meet at a single site and learn hands-on about our plans, features, and visions for our areas. The workshops are essentially run as small conferences that range in size from tens to perhaps one hundred people. Coordinating them is always challenging (and fun).

 

In this post I’m going to share a simple Visio 2007 diagram I use to communicate the conference schedule. There’s nothing special in terms of “smart” shapes in the diagram – just a straightforward set of shapes arranged to show a day-by-day schedule. Please feel free to reuse and repurpose.

The Visio file is on my skydrive.

image

Posted by saveenr | 2 Comments

Beautiful New Segoe UI Fonts in Windows 7

After I installed with the Windows 7 Release candidate, I discovered that Windows 7 comes with some additional variants of the Segoe UI font that first shipped in Vista. I love the Segoe UI (and original Segoe font) and so it’s nice to see that we now have more typographic options with Windows 7.

 

  IN VISTA IN WINDOWS 7
Segoe UI (Regular) YES YES
Segoe UI Bold YES YES
Segoe UI Bold italic YES YES
Segoe UI Italic YES YES
Segoe UI Light NO YES
Segoe UI Semibold NO YES

 

THE WINDOWS 7 FONTS CONTROL PANEL

Let’s take this opportunity to explore the new Control Panel UI for fonts …

First launch the Control Panel

image

Click Appearance and Customization

image

Click Fonts

image

 

Now we can see all the fonts on the system

 

image

There are many of them, so type “segoe” in the Search Fonts box in the upper right

image

And you’ll see the fonts with “Segoe” in their name.

Right-click on “Segoe UI” and select Open

image

And now you’ll see the name Segoe UI fonts

image

You can right click on each one and select Preview to see the font in Action…

image

PREVIEWS

SEGOE UI REGULAR

image

 

SEGOE UI LIGHT

image

SEGOE UI ITALIC

image

SEGOE UI BOLD

image

SEGOE UI BOLD ITALIC

image

 

SEGOE UI SEMIBOLD

image

Posted by saveenr | 2 Comments

Monitoring ReadyBoost on Windows 7

I purchased a Kingston DataTraveller 400 (4GB) to try out ReadyBoost on my Dev workstation. My initial impression is that it has visibly improved application launch time (Visual Studio 2008 was definitely faster – but YMMV). Out of curiosity I had to see how Windows 7 could monitor ReadyBoost performance.

Below are the step-by-step instructions for monitoring it via Performance Monitor using the Windows 7 Beta build.

 

STEPS

Launch the Control Panel from the start menu

image

Click All Control Panel Items

image

Click Performance Information and Tools

image

Click Advanced Tools

image

Click Open Performance Monitor

image

Click Performance Monitor

image

Click the Green PLUS sign

image

The Add Counters dialog appears

Select ReadyBoost Cache

image

Click Add

image

Now “ReadyBoost Cache” will appear on the right.

Click OK

image

And now Performance Monitor shows ReadyBoost data

image

 

FASTER WAYS OF LAUNCHING PERFORMANCE MONITOR

You can always search for “Performance Monitor” directly …

image

 

Or if you’ve enabled Administrative Tools from the Start Menu …

image

Posted by saveenr | 1 Comments

Visio: Transparencies and Soft Shadows

In my first screencast (Visio- Expressive Diagrams Demo) I showed how to use the Visio ShapeSheet to create some nice effects with transparencies. In my new screencast I show how to use some pre-built shapes to easily build transparency effects without using the shapesheet at all.

image

Link to video: http://vimeo.com/4218850

 

Diagrams with Sample Shapes used in the ScreenCast

Sample Gradient Transparencies

http://cid-19ec39cb500669d8.skydrive.live.com/self.aspx/Public/Visio/Shapes/Shapes-with-Gradient-Transparencies.vsd

Soft Shadows

http://cid-19ec39cb500669d8.skydrive.live.com/self.aspx/Public/Visio/Shapes/Soft-Shadows-and-Shapes.vsd

Posted by saveenr | 2 Comments

Visio: Spirograph sample

 

Last month while playing around with some code samples for my visio automation library I stumbled on Veerle’s blog post about making Spirographs with Adobe illustrator

image

Which was, in turn inspired by the work of Andy Gilmore.

I liked the look so much I decided to replicate it in Visio 2007. Below is a screenshot of what I was able to generate.

image

 

Link to the Visio file: http://cid-19ec39cb500669d8.skydrive.live.com/self.aspx/Public/Visio/Sample%20Files/Spirograph-%7C52009-03-18%7C6.vsd

 

 

Combining Code and Direct Manipulation

Note that this sample goes through the VisioInteractive API which is intended to be used via IronPython. However, to make it easier for me to run the test cases and perform refactoring, I’ve written the sample in C# and added some helper functions to make it look more like the final Python code.

The code generates a very plain looking Sirograph…

 

image

 

And then by playing around with the fill settings and shape heights and sizes, I made the final Spirographs. So for example, select all the shapes, bring up the Shape & Position window

 

image

 

And then set the Width to 6.0 …

 

image

 

 

 

 

public IVisio.Shape draw_leaf(Isotope.Drawing.Point p0)
{
    var vi = this.Shell;
    var p1 = p0.Add(1, 1);
    var p2 = p1.Add(1, 0);
    var p3 = p2.Add(1, -1);
    var p4 = p3.Add(-1, -1);
    var p5 = p4.Add(-1, 0);
    var p6 = p5.Add(-1, 1);
    var bezier_points = vi.Drawing.Points(p0, p1, p2, p3, p4, p5, p6);
    var s = vi.Draw.Bezier(bezier_points);
    return s;
}

public void Demo07_Spirograph()
{
    var vi = this.Shell;

    vi.Page.New();
    vi.Page.Name = "Spirograph";

    var colors =
        list(0xf26420, 0xf7931c, 0xfec20d, 0xfff200, 0xcada28, 0x8cc63e, 0x6c9d30, 0x288f39, 0x6f3a, 0x6f71,
             0x8eb0, 0xadee, 0x8ed3, 0x71bb, 0x53a6, 0x2e3091, 0x5b57a6, 0x652d91, 0x92278e, 0xbd198c, 0xec008b,
             0xec1c23, 0xc1272c, 0x981a1e);

    var origin = vi.Drawing.Point(4, 4);
    double radius = 3.0;
    int numpoints = colors.Count();
    double angle_step = (System.Math.PI*2/numpoints);
    var indices = Enumerable.Range(0, numpoints);
    var angles = list(indices.Select(i => i*angle_step));
    var centers = list(angles.Select(a => vi.Drawing.GetPointAtRadius(origin, a, radius)));
    var shapes = list(centers.Select(p => draw_leaf(p)));
    var angles_as_degrees = list( angles.Select(a => vi.Drawing.RadiansToDegrees(a)) );

    vi.Select.None();
    vi.Select.Select(shapes);
    vi.Fill.ForegroundColor = colors;
    vi.XForm.Angle = angles_as_degrees;
    vi.Line.Weight = list(0.0);
    vi.Line.Pattern = list(0);
    vi.Fill.ForegroundTransparency = list(0.5);
    vi.Page.ResizeToFitContents(1.0, 1.0);
}

Posted by saveenr | 2 Comments

Pixels: LineoGrammer – Pen-centric Diagram Creation

Brown University’s LineoGrammer demonstrates excellent integration with pen gestures to create drawings. Words don’t do it justice - watch the amazing video on YouTube:

image

http://www.youtube.com/watch?v=1-Hcz1DKfdo

 

And here’s a link to a PDF with more detail

image

http://www.cs.brown.edu/people/acb/papers/lineogrammer-2008.pdf

Posted by saveenr | 1 Comments

An Update to my VisioAutomation Library & Tools Project

While preparing for my most recent demo I updated the automation libraries and code for Visio 2007- Version 1.1.3 is now available on CodePlex.

 

CHANGE LOG

WHAT’S NEXT

  • The version 1.x branch is in maintenance mode now
  • All my new work is on version 2.0
  • Some updates available in version 2.0
    • Further enhancements to PSVisioSnapIn
    • Visio Helper Add-in –> renamed to Visio Power Tools + new features (eye dropper color picker, etc.)
    • Simplification of the VisioAutomation APIs
  • Planned updates
    • Generation of Visio XML files without Visio
Posted by saveenr | 1 Comments

Visio: Expressive Diagrams Demo

Earlier in March I gave a demo to Visio users at Microsoft. My presentation was two elements: (1) how to use Visio to create “Expressive Diagrams” – rich, nice looking drawings and (2) advanced tools I built to optimize my own use of Visio. It was exciting to share what I’ve been doing as a Visio user and developer. Because that was an internal presentation I can’t share the recording I made so I re-recorded the demo and uploaded it to vimeo: http://vimeo.com/3813486

 

If you are interested in making diagrams look nice, you should check out this video

image

Posted by saveenr | 3 Comments

Dynamics AX 2009: Business Intelligence – How Data Flows into AX SSRS Reports and Excel

In Dynamics AX 2009, there are many ways to get access to BI data. In fact there are so many paths and options that it is difficult to keep the entire story straight even for people working on the AX team.

To help people understand get a grasp of what is happening, I recently put together the simple diagram below. I hope you’ll find useful in planning your AX 2009 deployments.

 

PDF file: http://cid-19ec39cb500669d8.skydrive.live.com/self.aspx/Public/Dynamics/Dynamics-AX-2009-Business-Intelligence-Reporting-Data-Access-in-AX2009.pdf

image

Posted by saveenr | 4 Comments
More Posts Next page »
 
Page view tracker