.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

access the options thru com

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
JONTHEPOPE
408 Views, 4 Replies

access the options thru com

In autocad 2014 help section for setting autocad preferences I would like to change the cross hair sizes to 100 but it isn't working because the interop is underlined???

any Ideas how I can fix my mistake?

 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Autodesk.AutoCAD.EditorInput;
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.Runtime;
using Autodesk.AutoCAD.Interop;
 
[CommandMethod("PrefsSetCursor")]
public static void PrefsSetCursor()
{
    // This example sets the crosshairs for the drawing window
    // to full screen.
 
    // Access the Preferences object
    AcadPreferences acPrefComObj = (AcadPreferences)Application.Preferences;
 
    // Use the CursorSize property to set the size of the crosshairs
    acPrefComObj.Display.CursorSize = 100;
}

 

 

4 REPLIES 4
Message 2 of 5
JONTHEPOPE
in reply to: JONTHEPOPE

How do I reference the autocad type libary?

 

Message 3 of 5
mcicognani
in reply to: JONTHEPOPE

Add a reference to your project and selecting from COM source 'AutoCAD 201x Type Library', where x will be the version you want to target.

You'll get the namespace Autocad, where is defined AcadPreferences.

If you say Interop is 'underlined', I guess you're targeting AutoCAD 2015, since that namespace is not present anymore. Use Autocad namespace instead and System.Runtime.InteropServices if needed.

Message 4 of 5
JONTHEPOPE
in reply to: mcicognani

at step two I can't find the file AsdkMfcComSamp.arx. or any .arx files

Where can I find the .arx file?

 

This sample demonstrates some of the many uses of COM access using MFC.

1. Start AutoCAD and open a new drawing.

2. Type the ARX command and load AsdkMfcComSamp.arx.

3. Type mfccommenu command. Notice that the AutoCAD menu now has an asdkcomaccess pulldown menu.

4. From askdcomaccess menu, use add a com circle and/or autolisp example.

Message 5 of 5
JONTHEPOPE
in reply to: JONTHEPOPE

found it the reference is in the objARX inc file. Smiley Happy nice

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost