Results 1 to 2 of 2

Thread: Initialize Macro in VSTA

  1. #1
    Member
    Join Date
    2007-10
    Posts
    47
    Login to Give a bone
    0

    Default Initialize Macro in VSTA

    I am using C#.

    Is it any difference between those two initialization below?
    Autodesk.Revit.UI.UIApplication app = this.Application;
    1.) Autodesk.Revit.DB.Document doc = this.Document;
    2.)Autodesk.Revit.DB.Document doc = app.ActiveUIDocument.Document;

    If they are the same which one is the most commonly use?

    Thanks in advance

  2. #2
    Member
    Join Date
    2001-07
    Location
    Dallas
    Posts
    19
    Login to Give a bone
    0

    Default Re: Initialize Macro in VSTA

    Quote Originally Posted by ckc.mike View Post
    I am using C#.

    Is it any difference between those two initialization below?
    Autodesk.Revit.UI.UIApplication app = this.Application;
    1.) Autodesk.Revit.DB.Document doc = this.Document;
    2.)Autodesk.Revit.DB.Document doc = app.ActiveUIDocument.Document;

    If they are the same which one is the most commonly use?

    Thanks in advance
    I'm not sure if there's any right answer here, ..it boils down to your preference and programming style, VSTA gives you both "this." for c# and "me." for vb.net.

    If your goal is to remain in VSTA then your safe, .. however if you are to port code over to API dll's then you may want to consider avoiding "this."

Similar Threads

  1. CP222-2: Autodesk Revit VSTA: Writing Your First Macro An Introduction to the Macro Manager
    By Autodesk University in forum Customization and Programming
    Replies: 0
    Last Post: 2014-12-01, 02:12 AM
  2. can't create VSTA MACRO Revit 2013
    By avzalingen811374 in forum Revit - API
    Replies: 0
    Last Post: 2012-09-25, 11:19 AM
  3. Revit architecture macro VSTA tutorial
    By hhhnzw in forum Revit - Tutorials
    Replies: 0
    Last Post: 2011-06-05, 11:56 AM
  4. Share VSTA macro's? Or build them in Visual Studio?
    By nicholas.hendrickx in forum Revit - API
    Replies: 2
    Last Post: 2009-05-19, 08:04 AM
  5. Revit Architecture 2009 VSTA Macro Manager Bug?
    By FWSchreck in forum Revit - API
    Replies: 1
    Last Post: 2009-03-27, 05:22 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •