Jump to content

Search the Community

Showing results for tags 'interop'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • CADTutor
    • News, Announcements & FAQ
    • Feedback
  • AutoCAD
    • AutoCAD Beginners' Area
    • AutoCAD 2D Drafting, Object Properties & Interface
    • AutoCAD Drawing Management & Output
    • AutoCAD 3D Modelling & Rendering
    • AutoCAD Vertical Products
    • AutoCAD LT
    • CAD Management
    • AutoCAD Bugs, Error Messages & Quirks
    • AutoCAD General
    • AutoCAD Blogs
  • AutoCAD Customization
    • The CUI, Hatches, Linetypes, Scripts & Macros
    • AutoLISP, Visual LISP & DCL
    • .NET, ObjectARX & VBA
    • Application Beta Testing
    • Application Archive
  • Other Autodesk Products
    • Autodesk 3ds Max
    • Autodesk Revit
    • Autodesk Inventor
    • Autodesk Software General
  • Other CAD Products
    • BricsCAD
    • SketchUp
    • Rhino
    • SolidWorks
    • MicroStation
    • Design Software
    • Catch All
  • Resources
    • Tutorials & Tips'n'Tricks
    • AutoCAD Museum
    • Blocks, Images, Models & Materials
    • Useful Links
  • Community
    • Introduce Yourself
    • Showcase
    • Work In Progress
    • Jobs & Training
    • Chat
    • Competitions

Categories

  • Programs and Scripts
  • 2D AutoCAD Blocks
  • 3D AutoCAD Blocks
  • Images
    • Backgrounds

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Found 2 results

  1. I'm writing a program to import a WMF into the AutoCad Drawing. I haven't been able to find any reference for the import command, so I can't figure out why it's not working. According to Visual Studio, the Import command needs these things to work. Import(String FileName, Object InsertionPoint, Double ScaleFactor) Simplified Code: Imports Autodesk.AutoCAD.Runtime Imports Autodesk.AutoCAD.ApplicationServices Imports Autodesk.AutoCAD.DatabaseServices Imports Autodesk.AutoCAD.Geometry Imports Autodesk.AutoCAD.EditorInput Imports Autodesk.AutoCAD.Interop Dim AcadApp As Autodesk.AutoCAD.Interop.AcadApplication AcadApp = CType(GetObject(, "AutoCAD.Application.18.2"), Autodesk.AutoCAD.Interop.AcadApplication) acadDoc = AcadApp.ActiveDocument acadDoc.Import("C:\Users\C\Documents\Drawing1.wmf", New Point3d(2, 2, 0), 2.0) When I comment out the last line of code, acadDoc.Import("C:\Users\C\Documents\Drawing1.wmf", New Point3d(2, 2, 0), 2.0) It runs fine. The error I'm getting is when I run it AutoCAD, ************** Exception Text ************** System.ArgumentException: Value does not fall within the expected range. at System.StubHelpers.ObjectMarshaler.ConvertToNative(Object objSrc, IntPtr pDstVariant) at Autodesk.AutoCAD.Interop.IAcadDocument.Import(String FileName, Object InsertionPoint, Double ScaleFactor) at TestSelectingFiltering.TestSelecting.MyCommands.FilterBlueCircleOnLayer0() at Autodesk.AutoCAD.Runtime.CommandClass.InvokeWorker(MethodInfo mi, Object commandObject, Boolean bLispFunction) at Autodesk.AutoCAD.Runtime.CommandClass.InvokeWorkerWithExceptionFilter(MethodInfo mi, Object commandObject, Boolean bLispFunction) at Autodesk.AutoCAD.Runtime.PerDocumentCommandClass.Invoke(MethodInfo mi, Boolean bLispFunction) at Autodesk.AutoCAD.Runtime.CommandClass.CommandThunk.Invoke() Any help would be greatly appreciated, Thanks!
  2. okay, im trying to get a connection to 2006 and im having problems. i used keen(through the interface) example and its throwing a COM exception, BUT it is creating the instance of autocad. I dont think it is connected to it, but it creates it. NOW, when i downloaded the objectARX for 2006 there where no interop.dll's just the 3 "acdbmgd" variations... im just learing how to work with c#. Can some one throw me a little bone here here is my code. public MainForm() { InitializeComponent(); IMessageFilter oldFilter = default(IMessageFilter); CoRegisterMessageFilter(this, oldFilter); AcadApplication acApp = GetAcApp("AutoCAD.Application.16.2"); } public AcadApplication GetAcApp(string progID){ AcadApplication acApp = null; try { acApp = (AcadApplication)Marshal.GetActiveObject(progID); } catch { try { Type acType = Type.GetTypeFromProgID(progID); acApp = (AcadApplication)Activator.CreateInstance(acType,true); } catch { MessageBox.Show("Cannot create object of type \"" + progID + "\""); } } if (acApp != null) { // By the time this is reached AutoCAD is fully // functional and can be interacted with through code acApp.Visible = true; return acApp; } return null; }
×
×
  • Create New...