Visio-rrible



  • My favorite features in Visio:

    • When using the interop API, double-quotes must be included when setting the Formula property (which is a string); forgetting the double-quotes won't cause an error but the formula will be ignored. Ex:
      Cells[x].Formula = @""Width * 2"";
    • The GUARD() function used in the shape properties prevents one from changing the value, even using the API... unless the relevant "*force" method is used. So one can use the SetFormula method or the SetFormulaForce, depending on the value given to the decision made by the document's author of defining some properties as read-only. On a side note: I am really disappointed that there is no GUARDAGAINSTFORCE() method.
    • A group of shapes is actually a Shape that has multiple shapes in the shape.Shapes collection, some of which may or may not be groups themselves (or masters), and any group may have a special configuration preventing some arbitrary properties to be modified (even using the *force methods). Programmatically changing the color of a shape in a Visio document is an adventure in the land of Recursion and Try-Catch.
    • Some properties of a shape are actual properties, while other are defined as entries in the Cells property.
      • Want to change the fill style? Use the shape.FillStyle property.
      • Want to change the fill color? Use shape.Cells["FillBkgnd"].Formula (and don't forget the double double-quotes in the value)

      But the really, really nice feature in Visio is the hidden "Document Stencil" which is some kind of weird cache for the master shapes being used in a document, preventing a modification on a master to trickle down to the shapes that are already drawn in the document. Unsurprisingly the "Document Stencil" is read-only for users but there is at least a checkbox to unhide it (of course the checkbox is in the Developer tab which is hidden by default).



  • I remember when I had to do something with Visio about 7 years ago, and my hazy recollections say that you're selling the API short. It's much worse than that. I can only assume that your brain is bleeding from trying to get something done with it.



  • All of the COM interop stuff for Microsoft Office (and related apps such as Visio) is horrible. Absolutely horrible, every last bit. Carving out your own organs with a plastic spork and spoon-feeding them to your children is less painful and traumatic for all parties involved than working with the Office COM API.



  • @mott555 said:

    All of the COM interop stuff for Microsoft Office (and related apps such as Visio) is horrible. Absolutely horrible, every last bit. Carving out your own organs with a plastic spork and spoon-feeding them to your children is less painful and traumatic for all parties involved than working with the Office COM API.

    They made a special effort for the one in Word, where many methods return a 1-based array that cannot be read directly in C# (getting the pleasant exception: string[] is not a valid cast for string[*])



  • @mott555 said:

    Carving out your own organs with a plastic spork and spoon-feeding them to your children...

    Wouldn't that be "spork-feeding them to your children"? Or are you being wasteful and using two entirely different disposable utensils when one would suffice?



  •  I used Visio once.

    It made me want to rape and kill.



  • @da Doctah said:

     I used Visio once.

    It made me want to rape and kill.

    I don't know about programming against its API, but I've used Visio quite a bit (as well as many other graphing and modeling tools) and I've found it to be the best, by far.


  • Winner of the 2016 Presidential Election

    My main peeve with Visio (and it's really frustrating to me) is that you can only connect a line to a shape at the center of the edge of the shape. Sure, you can draw lines to a shape anywhere along its edge, but the association won't be maintained if you drag the shape later. Many times I had a dozen or more lines attached to a rectangle, and I didn't want the lines to overlap so the crows' feet could be read clearly; then, inevitably, I needed to shuffle things around to avoid overlaps and suddenly I have to connect all the lines over again. And if you try to drag the lines and the shapes together, then it helpfully connects the lines to some unrelated shape because it thinks the line is still an orphan.

    It's one gripe, but it makes the tool damn near unusable sometimes.



  • @joe.edwards said:

    My main peeve with Visio (and it's really frustrating to me) is that you can only connect a line to a shape at the center of the edge of the shape. Sure, you can draw lines to a shape anywhere along its edge, but the association won't be maintained if you drag the shape later. Many times I had a dozen or more lines attached to a rectangle, and I didn't want the lines to overlap so the crows' feet could be read clearly; then, inevitably, I needed to shuffle things around to avoid overlaps and suddenly I have to connect all the lines over again. And if you try to drag the lines and the shapes together, then it helpfully connects the lines to some unrelated shape because it thinks the line is still an orphan.

    It's one gripe, but it makes the tool damn near unusable sometimes.

    You can change the connection point settings to solve this problem. It's not intuitive but it should work.


  • Winner of the 2016 Presidential Election

    @Speakerphone Dude said:

    You can change the connection point settings to solve this problem. It's not intuitive but it should work.

    A helpful reply? Are you sure you're on the right website?



  • @mott555 said:

    All of the COM interop stuff for Microsoft Office (and related apps such as Visio) is horrible.


    Isn't it possible to avoid the COM interop stuff entirely by using the libraries for OOXML? I understood from a former colleague who had used the old COM libraries and the more recent ones that things had got much better.



  • @morbiuswilters said:

    @da Doctah said:

     I used Visio once.

    It made me want to rape and kill.

    I don't know about programming against its API, but I've used Visio quite a bit (as well as many other graphing and modeling tools) and I've found it to be the best, by far.

    Me too. I even painted entity-relationship models with it - and liked it (but maybe I am simply a masochist...)

     



  • @TheRider said:

    @morbiuswilters said:
    @da Doctah said:

    I used Visio once.

    It made me want to rape and kill.

    I don't know about programming against its API, but I've used Visio quite a bit (as well as many other graphing and modeling tools) and I've found it to be the best, by far.

    Me too. I even painted entity-relationship models with it - and liked it (but maybe I am simply a masochist...)

    The normal interface is fine. The API feels like it was deliberately sabotaged, or at built from best practices garnered from the front page around here.


  • @boomzilla said:

    The API feels like it was deliberately sabotaged, or at built from best practices garnered from the front page around here.

    You know, I used to wonder where Intuit got the ideas they used to build the QuickBooks SDK, but I think you just explained it for me...

     



  • @pjt33 said:

    @mott555 said:

    All of the COM interop stuff for Microsoft Office (and related apps such as Visio) is horrible.


    Isn't it possible to avoid the COM interop stuff entirely by using the libraries for OOXML? I understood from a former colleague who had used the old COM libraries and the more recent ones that things had got much better.

    This works on recent version for Word and Excel (those with the "x" at the end of the extension meaning that it's the xml-based format). For Visio, there has been a lot of "stability" in the API for the last 10 years...



  • @mott555 said:

    All of the COM interop stuff for Microsoft Office (and related apps such as Visio) is horrible. Absolutely horrible, every last bit. Carving out your own organs with a plastic spork and spoon-feeding them to your children is less painful and traumatic for all parties involved than working with the Office COM API.

     

    I tried to learn COM by programming against the MS Office API.  Then I decided to give up and do something more fun, like pound nails through my dick.



  • @Speakerphone Dude said:

    My favorite features in Visio [...]

    I have an addendum: for some reason they seem to have removed multi-threading from the search function after Visio 2003; now whenever one is searching for a shape the whole GUI is frozen and non-responsive until the search is completed.



  • @Cat said:

    @mott555 said:

    All of the COM interop stuff for Microsoft Office (and related apps such as Visio) is horrible. Absolutely horrible, every last bit. Carving out your own organs with a plastic spork and spoon-feeding them to your children is less painful and traumatic for all parties involved than working with the Office COM API.

     

    I tried to learn COM by programming against the MS Office API.  Then I decided to give up and do something more fun, like pound nails through my dick.

    BTW, Excel is the model for "how you're supposed to do it", the other Office apps are train wrecks. The APIs are also designed to be used from a language that supports optional parameters, like VB. VB6 and VB.Net have always worked very well with them, the experience from C# was horrendous until .Net 4.0. Office COM is also a lot better from a runtime that uses reference counting rather than garbage collection.


Log in to reply
 

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.