Jump to content

Search the Community

Showing results for tags '.net'.

  • 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 16 results

  1. I am building a .NET app for ACAD 2024 and have a question about dependent DLLs. In the Initialize method of my IExtensionApplication app I have this... public void Initialize() { var editor = AcadLib.Instance.Editor; editor.WriteMessage("\nLoading SuperDuperApp v2024.2... "); try { var executingAssemblyLocation = Assembly.GetExecutingAssembly().Location; var baseDirectory = Path.GetDirectoryName(executingAssemblyLocation); editor.WriteMessage("\nSuperDuperApp Support Assemblies... "); // support assemblies TryToLoadAssembly($"{baseDirectory}\\Csv.dll"); TryToLoadAssembly($"{baseDirectory}\\CommonServiceLocator.dll"); This way I should only need to load the top level DLL (automatically, or otherwise) and everything dependent loads during initialization. This is a WPF app living in a palette set and using MVVM. I am using the older Galasoft MVVMLight library because I've found ACAD really doesn't like the newer community version. Too bad. That CommonServiceLocator is being a problem though. If I don't have the directory with my app in it in the support file search path, ACAD complains that my ViewModelLocator class can't find the CommonServiceLocator, despite it being pre-loaded into the .NET sandbox. Is there a way to specify a search location or should I just let everything load on demand by going through the support search path?
  2. I am making a free topo tool that makes use of Mapsui maps ( https://github.com/Mapsui/Mapsui ) that reads and manipulates shape and KMZ files and then inserts them in model space already projected. The problem is that it doesn't show the map inside the window, I don't know if I have to do it asynchronous, with threads or I need to give it permission for external connections. I had already been able to display Arcgis Runtime maps but they were only displayed in AutoCAD 2020 and 2021, so I decided to use MapSui but the result was worse. I am using the Autoloader (.bundle) structure to run the command, in that same folder I put all the necessary files for the map to work, but still it doesn't do it, it doesn't even give error. Does anyone know why this happens? or do you have any alternative for the map, it should be noted that I do not want to use the map that brings autocad because it is only available in the 2015 version onwards and I need it from 2013 and its projection systems are limited to UTM. Technologies: C# WPF Visual studio 2019 Autocad dll base 2013 Mapsui If you want me to pass you the project or .bundle folder, please comment
  3. Hello, I have just stepped into .Net and I am currently having difficulty determining the point I have just chosen on the Object (here is the circle) I have read this post and I use the class DisplacementJig to move the circle: https://www.keanw.com/2013/12/moving-text-in-an-autocad-block-using-net-part-2.html the problem is that when I select the circle, the point I just selected [Promptpoint.Pickedpoint ] is not on the circle. so when I move the circle I won't get to the point I want Can you guide me further? thank you very much.
  4. what I'm trying to do is, Check if there any (not found, or not resolved Xref's Proceed to Bind) If their Xrefs need to reload (Reload them) and then Bind all resolved Xrefs. ObjectIdCollection btrCol = new ObjectIdCollection(); XrefGraph xrgraph = doc.Database.GetHostDwgXrefGraph(false); db.ResolveXrefs(true, false); for (int i = 1; i < (xrgraph.NumNodes); i++) { XrefGraphNode xrNode = xrgraph.GetXrefNode(i); switch (xrNode.XrefStatus) { case XrefStatus.Resolved: btrCol.Add(xrNode.BlockTableRecordId); break; case XrefStatus.Unloaded: btrCol.Add(xrNode.BlockTableRecordId); break; case XrefStatus.FileNotFound: break; case XrefStatus.NotAnXref: break; case XrefStatus.Unreferenced: break; } } try { if (btrCol.Count > 0) { db.ReloadXrefs(btrCol); db.BindXrefs(btrCol, true); } } In debug mode, the code going well and I check the ObjectIdCollection, and it contains the target Xrefs and voids the (unresolved) Xref's as I need. But not Bind or Reload. the conclusion is: I need the code to Reload all Xref's need to reload. then Bind all. regardless any Xref's (Not Found, Not an Xref, etc...) as the attached lisp. (defun c:bindloaded(/ cObj cName) (setq cObj(tblnext "BLOCK" T)) (while cObj (setq cName(cdr(assoc 2 cObj))) (if (and (=(logand(cdr(assoc 70 cObj))32)32) (=(logand(cdr(assoc 70 cObj))4)4) ); end and (progn (vl-cmdf "bindtype" "1") (vl-cmdf "_.xref" "_unload" cName) (vl-cmdf "_.xref" "_reload" cName) (vl-cmdf "_.xref" "_bind" cName) ); end progn ); wnd if (setq cObj(tblnext "BLOCK")) ); end while (princ) ); end of c:bindloaded thanks in advance.
  5. Hi All, I have just hit a wall with some code I am working on and wondered if anyone had seen a similar situation (and found a solution). I have written a .NET routine that I use to control which Ribbon Menu Tabs and Panels are visible based on arguments passed to the routine. This runs correctly in AutoCAD 2016 when I call it from the command line or from inside a lisp function or command. However when I call the .NET routine from a reactor it fails: Command: System.ArgumentNullException: Value cannot be null. Parameter name: key at System.Collections.Generic.Dictionary`2.FindEntry(TKey key) at System.Collections.Generic.Dictionary`2.TryGetValue(TKey key, TValue& value) at Autodesk.AutoCAD.Runtime.PerDocumentCommandClass.Invoke(MethodInfo mi, Boolean bLispFunction) at Autodesk.AutoCAD.Runtime.CommandClass.CommandThunk.InvokeLisp(); error: ADS request error EDIT: I have found that calling ANY command from a reactor fails e.g. (command "line" "0,0" "1000,1000") called by a reactor the error is: Command: ; error: AutoCAD command rejected: "line" Any and all thoughts greatly appreciated. Colin
  6. WPerciful

    ArxDBG

    I can't seem to figure out how to load ArxDBG....
  7. I try to do a very simple thing : transform the absolute XREF links in relative in C#. I have no idea how can I translate the XREF path in relative. I don't know where I can start. I saw this article but does'nt help me ! Have you got information or details how can I do that? Thanks a lot,
  8. MrDharmarajan

    Fatal Error occur on runtime

    In ACAD2014, a custom application generating lines and text entity was unable to execute immediately after saveAs the DWG(It raises a fatal error). But the same application was able execute when re-open the same DWG. How to solve this?
  9. Please Help I am New to forum How to get duplicate and missing text number sequence in a particular layer in AutoCAD using .NET C#
  10. Hi I have an excel file with a column containing polygon vertices like follows: Row 1 x-Cord1|y-Cord1 x-Cord2|y-Cord2 x-Cord3|y-Cord3.... Row 2 x-Cord1|y-Cord1 x-Cord2|y-Cord2 x-Cord3|y-Cord3.... Row 3 x-Cord1|y-Cord1 x-Cord2|y-Cord2 x-Cord3|y-Cord3.... ......... I am looking for a .Net code that can read each row cell and draw the polygons automatically in AutoCAD window. I am having a bout 100 rows (polygons) and hence I prefer that the code will display all polygons at once in AutoCAD window and not draw them one by one. I am already having Autolisp code to draw them one by one but I wish to have a .Net code to allow batch polygons drawing instead. Thanks a lot for any assistance
  11. I created a drawing that varies hole spacing on a peice of angle iron using parameters,but it would be very beneficial to incorporate if-then statements to control the value of some of parameters based on the value of other parameters. An example of this is, if d1 parameter = 14 then d2parameter = 3 elesif d1 parameter = 15 then d2 parameter = 2. I got this idea from iLogic in Inventor, which is very easy to use. Im aware AutoCAD does not have this functionallity, but I think programing such as VBA could help me with my issue. I do not have a strong programing backround so any advise is appretiated.
  12. Hello everyone, I have project requirement to create asp.net web application to collect input about drawing file(.dwg). After users enters information,they will apply their own project information for generation of dwg. Meanwhile project have another component as window service which will use queue mechanism to gather all user projects and execute it one by one to create drawing file. Web application will be hosted on server. My question is: Can I use AutoCad 2012 License to achieve this for executing multiple request one by one ? Is it violation of any license terms for execution of multiple request? Pl advise asap. Many Thanks, Raj
  13. Hi all, How can i use the "JEPGEX" command in .net (equivalent solution is also fine). I have already the ObjectIds in my toll and i am exporting them to an XML file. But i also want to export an image of this Objects. Thank you for your efforts ahead.
  14. Hi community, my job is to make an editor for blocks in C#. There should be a WPF-window were the user can see a list of blocks. He selects one and than he should see an overview about block attributes like insertionpoint, basepoint, rotation and scaling and he should be able to edit these attributes in this form. I know how i can populate a list of block names, but I fail at finding an opportunity to edit these attributes. I get the blocktablerecords, but then? I am very, very new to Autocad, and I've googled the last five hours unsuccessfully for a solution which is suitable for my problem. Please help me, it is very urgent! Kind regards, Klaus
  15. I have been trying to work out a quick solution to a problem using .net but have been stumped by my lack of knowledge in programming. I need to write an app/plugin for autocad that will change the color of a layer when a checkbox is checked. I have been able to set up the user form but i am not sure how to code the actual changing of layer colors. Another feature i am trying to incorporate is the output filtering of the text contained on the layer which have had their colors changed to build an effect equipment list Any help would be greatly appreciated
  16. dbroada

    .Import equivalent?

    I am slowly going through my VBA routines looking for an easy one to convert to .NET and I thought I had found one.... Public Sub DxfImport(myFile As String) Dim P1(0 To 2) As Double Dim myScale As Double Dim myTest If Right$(myFile, 4) <> ".dxf" Then myFile = myFile & ".dxf" myTest = Dir$(myFile) If myTest <> "" Then P1(0) = 0: P1(1) = 0: P1(2) = 0 myScale = 1 ThisDrawing.Import myFile, P1, myScale End If End Sub however I can't get past the ThisDrawing.Import line. I have tried [font=Consolas][size=2] [/size][/font][font=Consolas][size=2][color=#0000ff][font=Consolas][size=2][color=#0000ff][font=Consolas][size=2][color=#0000ff]Public[/color][/size][/font][/color][/size][/font][/color][/size][/font][font=Consolas][size=2][color=#0000ff][font=Consolas][size=2][color=#0000ff][font=Consolas][size=2][color=#0000ff]Sub[/color][/size][/font][/color][/size][/font][/color][/size][/font][font=Consolas][size=2][font=Consolas][size=2] aNewBit([/size][/font][/size][/font][font=Consolas][size=2][color=#0000ff][font=Consolas][size=2][color=#0000ff][font=Consolas][size=2][color=#0000ff]ByVal[/color][/size][/font][/color][/size][/font][/color][/size][/font][font=Consolas][size=2][font=Consolas][size=2] myFile)[/size][/font] [/size][/font][font=Consolas][size=2][color=#0000ff][font=Consolas][size=2][color=#0000ff][font=Consolas][size=2][color=#0000ff]Dim[/color][/size][/font][/color][/size][/font][/color][/size][/font][font=Consolas][size=2][font=Consolas][size=2] acDoc [/size][/font][/size][/font][font=Consolas][size=2][color=#0000ff][font=Consolas][size=2][color=#0000ff][font=Consolas][size=2][color=#0000ff]As[/color][/size][/font][/color][/size][/font][/color][/size][/font][font=Consolas][size=2][color=#2b91af][font=Consolas][size=2][color=#2b91af][font=Consolas][size=2][color=#2b91af]Document[/color][/size][/font][/color][/size][/font][/color][/size][/font][font=Consolas][size=2][font=Consolas][size=2] = [/size][/font][/size][/font][font=Consolas][size=2][color=#2b91af][font=Consolas][size=2][color=#2b91af][font=Consolas][size=2][color=#2b91af]Application[/color][/size][/font][/color][/size][/font][/color][/size][/font][font=Consolas][size=2][font=Consolas][size=2].DocumentManager.MdiActiveDocument[/size][/font] [/size][/font][font=Consolas][size=2][color=#0000ff][font=Consolas][size=2][color=#0000ff][font=Consolas][size=2][color=#0000ff]Dim[/color][/size][/font][/color][/size][/font][/color][/size][/font][font=Consolas][size=2][font=Consolas][size=2] p1(0 [/size][/font][/size][/font][font=Consolas][size=2][color=#0000ff][font=Consolas][size=2][color=#0000ff][font=Consolas][size=2][color=#0000ff]To[/color][/size][/font][/color][/size][/font][/color][/size][/font][font=Consolas][size=2][font=Consolas][size=2] 2) [/size][/font][/size][/font][font=Consolas][size=2][color=#0000ff][font=Consolas][size=2][color=#0000ff][font=Consolas][size=2][color=#0000ff]As[/color][/size][/font][/color][/size][/font][/color][/size][/font][font=Consolas][size=2][color=#0000ff][font=Consolas][size=2][color=#0000ff][font=Consolas][size=2][color=#0000ff]Double[/color][/size][/font] [/color][/size][/font][/color][/size][/font][font=Consolas][size=2][color=#0000ff][font=Consolas][size=2][color=#0000ff][font=Consolas][size=2][color=#0000ff]Dim[/color][/size][/font][/color][/size][/font][/color][/size][/font][font=Consolas][size=2][font=Consolas][size=2] myScale [/size][/font][/size][/font][font=Consolas][size=2][color=#0000ff][font=Consolas][size=2][color=#0000ff][font=Consolas][size=2][color=#0000ff]As[/color][/size][/font][/color][/size][/font][/color][/size][/font][font=Consolas][size=2][color=#0000ff][font=Consolas][size=2][color=#0000ff][font=Consolas][size=2][color=#0000ff]Double[/color][/size][/font] [/color][/size][/font][/color][/size][/font][font=Consolas][size=2][color=#0000ff][font=Consolas][size=2][color=#0000ff][font=Consolas][size=2][color=#0000ff]Dim[/color][/size][/font][/color][/size][/font][/color][/size][/font][font=Consolas][size=2][font=Consolas][size=2] myTest[/size][/font] [/size][/font][font=Consolas][size=2][color=#0000ff][font=Consolas][size=2][color=#0000ff][font=Consolas][size=2][color=#0000ff]If[/color][/size][/font][/color][/size][/font][/color][/size][/font][font=Consolas][size=2][font=Consolas][size=2] Right(myFile, 4) <> [/size][/font][/size][/font][font=Consolas][size=2][color=#a31515][font=Consolas][size=2][color=#a31515][font=Consolas][size=2][color=#a31515]".DXF"[/color][/size][/font][/color][/size][/font][/color][/size][/font][font=Consolas][size=2][color=#0000ff][font=Consolas][size=2][color=#0000ff][font=Consolas][size=2][color=#0000ff]Then[/color][/size][/font][/color][/size][/font][/color][/size][/font][font=Consolas][size=2][font=Consolas][size=2] myFile = myFile & [/size][/font][/size][/font][font=Consolas][size=2][color=#a31515][font=Consolas][size=2][color=#a31515][font=Consolas][size=2][color=#a31515]".DXF"[/color][/size][/font] [/color][/size][/font][/color][/size][/font][font=Consolas][size=2][font=Consolas][size=2]myTest = Dir(myFile)[/size][/font] [/size][/font][font=Consolas][size=2][color=#0000ff][font=Consolas][size=2][color=#0000ff][font=Consolas][size=2][color=#0000ff]If[/color][/size][/font][/color][/size][/font][/color][/size][/font][font=Consolas][size=2][font=Consolas][size=2] myTest <> [/size][/font][/size][/font][font=Consolas][size=2][color=#a31515][font=Consolas][size=2][color=#a31515][font=Consolas][size=2][color=#a31515]""[/color][/size][/font][/color][/size][/font][/color][/size][/font][font=Consolas][size=2][color=#0000ff][font=Consolas][size=2][color=#0000ff][font=Consolas][size=2][color=#0000ff]Then[/color][/size][/font] [/color][/size][/font][/color][/size][/font][font=Consolas][size=2][font=Consolas][size=2]p1(0) = 0 : p1(1) = 0 : p1(2) = 0[/size][/font] [size=2][font=Consolas]myScale = 1[/font][/size] [size=2][font=Consolas]acDoc.IMPORT(myFile, p1, myScale)[/font][/size] [/size][/font][font=Consolas][size=2][color=#0000ff][font=Consolas][size=2][color=#0000ff][font=Consolas][size=2][color=#0000ff]Else[/color][/size][/font] [/color][/size][/font][/color][/size][/font][font=Consolas][size=2][font=Consolas][size=2]MsgBox([/size][/font][/size][/font][font=Consolas][size=2][color=#a31515][font=Consolas][size=2][color=#a31515][font=Consolas][size=2][color=#a31515]"File doesn't exist"[/color][/size][/font][/color][/size][/font][/color][/size][/font][font=Consolas][size=2][font=Consolas][size=2])[/size][/font] [/size][/font][font=Consolas][size=2][color=#0000ff][font=Consolas][size=2][color=#0000ff][font=Consolas][size=2][color=#0000ff]End[/color][/size][/font][/color][/size][/font][/color][/size][/font][font=Consolas][size=2][color=#0000ff][font=Consolas][size=2][color=#0000ff][font=Consolas][size=2][color=#0000ff]If[/color][/size][/font] [/color][/size][/font][/color][/size][/font][font=Consolas][size=2][color=#0000ff][font=Consolas][size=2][color=#0000ff][font=Consolas][size=2][color=#0000ff]End[/color][/size][/font][/color][/size][/font][/color][/size][/font][font=Consolas][size=2][color=#0000ff][font=Consolas][size=2][color=#0000ff][font=Consolas][size=2][color=#0000ff]Sub[/color][/size][/font] [/color][/size][/font][/color][/size][/font] but as you can see, Import hasn't been found in the acDoc object. Any ideas?
×
×
  • Create New...