Jump to content

Search the Community

Showing results for tags '.net api'.

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

  1. Hello guys, I'm trying to do a intersection dynamic block (name = "handrail") with user selected Line. This dynamic block is made up of polylines only. In the intersections points a need make a circles. This is my code, but is not working with dynamic block, only with static block. public static void FindIntersection(List<ObjectId> polylineIds) { Editor ed = Application.DocumentManager.MdiActiveDocument.Editor; PromptEntityOptions peo2 = new PromptEntityOptions("\nSelect a Line: "); peo2.SetRejectMessage("\nError, please select a Line"); peo2.AddAllowedClass(typeof(Line), true); PromptEntityResult res2 = ed.GetEntity(peo2); if (res2.Status != PromptStatus.OK) { return; } ObjectId lineId = polylineIds[0]; ObjectId line2Id = res2.ObjectId; Database db = Application.DocumentManager.MdiActiveDocument.Database; using (Transaction trans = db.TransactionManager.StartTransaction()) { Polyline poly = trans.GetObject(lineId, OpenMode.ForRead) as Polyline; Line line = trans.GetObject(line2Id, OpenMode.ForRead) as Line; BlockTable bt = trans.GetObject(db.BlockTableId, OpenMode.ForRead) as BlockTable; BlockTableRecord btr = trans.GetObject(bt[BlockTableRecord.ModelSpace], OpenMode.ForWrite) as BlockTableRecord; Line line2 = new Line(); line2.StartPoint = poly.StartPoint; line2.EndPoint = poly.EndPoint; line2.ColorIndex = 1; btr.AppendEntity(line2); trans.AddNewlyCreatedDBObject(line2, true); Point3dCollection intersectionPoints = new Point3dCollection(); line.IntersectWith(poly, Intersect.OnBothOperands, intersectionPoints, 0, 0); Point3d intersectionPoint = intersectionPoints[0]; double radius = 25.0; // Průměr 50 Circle circle = new Circle(intersectionPoint, Vector3d.ZAxis, radius); btr.AppendEntity(circle); trans.AddNewlyCreatedDBObject(circle, true); trans.Commit(); } } [CommandMethod("Intersections")] public static void CountPolylinesInBlock() { var doc = Application.DocumentManager.MdiActiveDocument; var db = doc.Database; var ed = doc.Editor; string blockName = "Handrail"; var polylineIds = new List<ObjectId>(); using (Transaction tr = db.TransactionManager.StartTransaction()) { var bt = (BlockTable)tr.GetObject(db.BlockTableId, OpenMode.ForRead); if (!bt.Has(blockName)) { ed.WriteMessage($"\nBlok '{blockName}' not found."); return; } var blkRecId = bt[blockName]; var blkRec = (BlockTableRecord)tr.GetObject(blkRecId, OpenMode.ForRead); foreach (ObjectId id in blkRec) { Entity ent = tr.GetObject(id, OpenMode.ForRead) as Entity; if (ent != null && ent is Polyline) { polylineIds.Add(id); } } tr.Commit(); } FindIntersection(polylineIds); }
  2. Dears, I am in need of any DLL or API (free / very low cost) to view the Autocad drawing file through my web-map application which was developed by using ASP.Net (C#). I got an opensource tool, that is Sharecad.org's iframe tool. But it requires the internet and public IP in the server to read our .dwg file. But my environment and requirements are viewing the dwg files without installing any Autocad software in intranet systems which are connected in LAN Network and read only option is enough with basic zoom in, zoom out and pan options. Seeking your suggestion and solution and it is more helpful to me. Thanks in Advance.
  3. 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?
  4. Hi, I have 2 display themes in my DWG, and would like to use the .NET API to activate one display theme and deactivate the other. I have searched AutoCAD forums and here, but there wasn't any threads on this. Current findings so far. Showing part of my code. DisplayTheme has the public data member IsActive, and I was able to access the 2 display themes in my DWG, whereby one is active, the other is not. Search through the list of DisplayTheme public methods, but there was not any that could activate or deactivate it. DisplayTheme dt = tm.GetObject(id, OpenMode.ForWrite) as DisplayTheme; ed.WriteMessage(dt.IsActive + "\n"); Any assistance would be great. Thanks.
×
×
  • Create New...