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; }
Solved! Go to Solution.
Solved by mcicognani. Go to Solution.
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.
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.