See the top rated post in this thread. Click here

Page 2 of 2 FirstFirst 12
Results 11 to 15 of 15

Thread: Autodesk University 2005: Code Download & Discussion

  1. #11
    Member
    Join Date
    2005-02
    Location
    Vienna, Austria
    Posts
    4
    Login to Give a bone
    0

    Default Re: Autodesk University 2005: Code Download & Discussion

    Thank you for this codes, will have a look at them

    Roland Feletic

  2. #12
    Active Member
    Join Date
    2002-06
    Location
    Portland, OR
    Posts
    83
    Login to Give a bone
    0

    Default Re: Autodesk University 2005: Code Download & Discussion

    Thanks a ton Bobby. I didn't get a chance to get to your class this last AU and I wish I had...this is GREAT stuff!

  3. #13
    Active Member pferreira's Avatar
    Join Date
    2006-06
    Location
    Lisbon, Portugal
    Posts
    88
    Login to Give a bone
    0

    Default Re: Autodesk University 2005: Code Download & Discussion

    I will see these code examples, because i am trying to learn ObjectArx and Autocad.Net.
    Thanks for the posts

  4. #14
    Woo! Hoo! my 1st post
    Join Date
    2005-08
    Posts
    1
    Login to Give a bone
    0

    Default Re: Autodesk University 2005: Code Download & Discussion

    I keep getting an AccessViolationException on the line containing ReadDWGFile. Do I need to set some sort of access level for the application. I have read/write access on the path containing the block file.

    Thanks,
    Adam

  5. #15
    Woo! Hoo! my 1st post
    Join Date
    2014-08
    Posts
    1
    Login to Give a bone
    0

    Default Re: Autodesk University 2005: Code Download & Discussion

    Hi, I see this is an old post.

    However, is there any way to exactly tell my new Pane WHERE to appear? Looping through the panes gives me no real information, where I will place my pane (using the insert method by defining an index) E.g. I'd like to place mine after the left set of Status switches. The only info I see is the Description wich varies by language Packs... I'm not familiar with C++, although I could try to get there by using the unmamanged object. But I have no Idea, how to get the items, don't know the method names, etc...
    Can you give a hint, where to start please?
    Thanks in advance,
    Daniel

    Quote Originally Posted by Bobby C. Jones View Post
    Example #2 - Adding buttons to the status bar

    Code:
     
    using System;
    
    using Autodesk.AutoCAD.Runtime;
    
    using Autodesk.AutoCAD.ApplicationServices;
    
    using acadApp = Autodesk.AutoCAD.ApplicationServices.Application;
    
    using Autodesk.AutoCAD.Windows;
    
    
    
    namespace AU2005.AcadApi
    
    {
    
         //Pages 7 & 8
    
         public class PaneButtonsExample
    
         {
    
              #region Application Pane
    
    
    
              [CommandMethod("CreateAppPane")]
    
              public static void AddApplicationPane()
    
              {
    
                  Pane au2005AppPaneButton = new Pane();
    
    
    
                  //Set the buttons properties
    
                  au2005AppPaneButton.Enabled = true;
    
    au2005AppPaneButton.Visible = true;
    
                  au2005AppPaneButton.Style = PaneStyles.Normal;
    
                  au2005AppPaneButton.Text = "AU2005 App. Pane";
    
    au2005AppPaneButton.ToolTipText = "Welcome to Autodesk University 2005!";
    
    
    
                  //Hook into the MouseDown event to run code when the button is pressed.
    
                  au2005AppPaneButton.MouseDown += new StatusBarMouseDownEventHandler(OnAppMouseDown);
    
    
    
                  //Add the button to the applications status bar
    
                  //Items can also be added to the tray area
    
                  acadApp.StatusBar.Panes.Add(au2005AppPaneButton);
    
              }
    
    
    
    
    
              private static void OnAppMouseDown(object sender, StatusBarMouseDownEventArgs e)
    
              {
    
                  Pane paneButton = (Pane) sender;
    
                  string alertMessage;
    
    
    
                  if (paneButton.Style == PaneStyles.PopOut)
    
                   {
    
                       paneButton.Style = PaneStyles.Normal;
    
                       alertMessage = "The application button is activated.";
    
                  }
    
                  else
    
                  {
    
                       paneButton.Style = PaneStyles.PopOut;
    
                       alertMessage = "The application button is de-activated.";
    
                  }
    
    
    
                  acadApp.StatusBar.Update();
    
    
    
                  acadApp.ShowAlertDialog(alertMessage);
    
              }
    
    
    
              #endregion
    
    
    
    
    
              //Document pane code not shown in the handout
    
              #region Document Pane
    
    
    
              [CommandMethod("CreateDocPane")]
    
              public static void AddDocumentPane()
    
              {
    
                  Pane au2005DocPaneButton = new Pane();
    
    
    
                  //Set the buttons properties
    
                  au2005DocPaneButton.Enabled = true;
    
    au2005DocPaneButton.Visible = true;
    
                  au2005DocPaneButton.Style = PaneStyles.Normal;
    
                  au2005DocPaneButton.Text = "AU2005 Doc. Pane";
    
    au2005DocPaneButton.ToolTipText = "Welcome to Autodesk University 2005!";
    
    
    
                  //Hook into the MouseDown event to run code when the button is pressed.
    
                  au2005DocPaneButton.MouseDown += new StatusBarMouseDownEventHandler(OnDocMouseDown);
    
    
    
                  //Add the button to the documents status bar
    
                   acadApp.DocumentManager.MdiActiveDocument.StatusBar.Panes.Add(au2005DocPaneButton);
    
              }
    
    
    
    
    
              private static void OnDocMouseDown(object sender, StatusBarMouseDownEventArgs e)
    
              {
    
                  Pane paneButton = (Pane) sender;
    
                  string alertMessage;
    
    
    
                  if (paneButton.Style == PaneStyles.PopOut)
    
                  {
    
                       paneButton.Style = PaneStyles.Normal;
    
                       alertMessage = "The document button is activated.";
    
                  }
    
                  else
    
                  {
    
                       paneButton.Style = PaneStyles.PopOut;
    
                       alertMessage = "The document button is de-activated.";
    
                  }
    
    
    
                   acadApp.DocumentManager.MdiActiveDocument.StatusBar.Update();
    
    
    
                  acadApp.ShowAlertDialog(alertMessage);
    
              }
    
    
    
              #endregion
    
         }
    
    }

Page 2 of 2 FirstFirst 12

Similar Threads

  1. Autodesk University 2005, Revit and ADT
    By phyllisr in forum Revit Architecture - General
    Replies: 3
    Last Post: 2005-09-21, 03:24 AM
  2. Autodesk University 2005
    By ssmith.54893 in forum Training
    Replies: 8
    Last Post: 2005-08-01, 08:14 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
  •