Jump to content

Search the Community

Showing results for tags 'autocad'.

  • 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...

  1. Hi my friends , Happy day.... I'm trying to solve an issue to help my non-coder friends. I'm using a Lisp file that contains all my routines, but I can't explain everything every time. So, I want to create a table inside AutoCAD that lists the shortcut commands and their descriptions, similar to how the TEXT COUNTER command works by Lee Mac. Any other suggestions could help me a lot. Thanks in advance my friends.... Attached is my lisp file Lisp Routine.lsp
  2. Hi, my ctb colours seem to select a lighter varient when plotted. For example, as you can see from the video, the colour 67 true colour is supposed to be 66,76,38, a dark shade of green. But when i confirm the colour and go back to select colour, its true colour is changed to a lighter shade, 131,149,74. Anyone know why? ScreenRecorderProject4.mp4
  3. I have similar blocks of drilling points on a map and wish to assign them to different layers to color them differently. How can I select blocks by their name, or part of their name, instead of handpick the individually? I also have Civil3D if that helps Thank you
  4. Dimensions are not visible. They appear only when I zoom in on the drawing. My AutoCAD version is 2009.
  5. I'm new to Lisp and trying calculate the distance from a wall to a polygon box, as well as the distance between two polygon boxes. Additionally, I need to determine the dimensions of both the polygon box and the wall. I'm using Lee Mac's dimensioning code as a reference and trying to modify it to achieve these calculations.can i get this type of outcome using lisp
  6. I am considering a transition from infrastructure and building structural detailing. What would most consider to be must have skills in O&G CAD work? Any additional info is more than welcome. TIA
  7. Hello everyone, can anyone help me, I have a case example that is almost similar to the actual case I am experiencing now. In the 1st picture I have a shapefile of the administrative boundaries of the United States that I have entered into autocad, the shp attribute has been entered into the data object of each feature with the data object name "GADM", in the data object there are State and County fields, for the layer of each feature I use the County field reference so that each feature is currently layered with its respective county name. what I want is that as in the 2nd picture I want each feature to be grouped or made per block per category of state, is there a quick way, because I think in each feature there is a State field? Noted: The Autocad that I use is AutocadMap 2021. Pic 1 Pic 2
  8. I have one AutoLISP to insert Dynamic Blocks containing Attributes. With this AutoLISP I can select the Value Attribute via the List DCL. I can insert Dynamic blocks wherever I want. The problem is, I want to use this AutoLISP by inserting dynamic blocks simultaneously at the midpoint of the line. what should I do? can anyone help me Thank You
  9. I have created a new pipe catalogue from existing steel pipes catalogue. This is showing in my catalogue editor, but when I am defining pipe routing preference these new catalogue items are not showing up. what step am i missing?
  10. (defun c:deleteCirclesByDiameter () (setq f 0.5000) (setq ss (ssget "_X" '((0 . "CIRCLE")))) (if ss (progn (setq index 0) (repeat (sslength ss) (setq ent (ssname ss index)) (if ent (progn (setq diameter (cdr (assoc 40 (entget ent)))) (setq dia (* diameter 2)) (prompt (strcat "\nCircle: " (itoa (1+ index)) ", Diameter: " (rtos dia 2 4))) (if (and (> x f) (< dia x) (not (= dia 0.6875 x 0.75)) (not (= dia 0.6880 x 0.75))) (progn (entdel ent) (prompt (strcat "\nDeleted Circle: " (itoa (1+ index)) ", Diameter: " (rtos dia 2 4) ", Thickness: " (rtos x 2 4))) ) (progn (entdel ent) (prompt (strcat "\nDeleted Circle: " (itoa (1+ index)) ", Diameter: " (rtos dia 2 4) ", Thickness: " (rtos x 2 4))) ) ) (progn (entdel ent) (prompt (strcat "\nDeleted Circle: " (itoa (1+ index)) ", Diameter: " (rtos dia 2 4))) ) ) ) (setq index (1+ index)) ) ) ) (prompt "\nCircles with diameter less than x have been deleted.") ) (prompt "\nNo circles found in the drawing.") ) (princ) ) In this code, help me to fix my mistakes in if conditions..
  11. Hi everyone, I'm relatively new to VB and AutoCAD, and I've been trying to incorporate a command line method into my existing code to copy, move, and scale a drawing. However, I've hit a roadblock and would appreciate some guidance. Every time I try to run the code, I encounter an error stating "acdbmgd.dll not found." From what I understand, this seems to be related to a missing reference or dependency associated with AutoCAD libraries. Here's the code I've been working on: Imports Autodesk.AutoCAD.Runtime Imports Autodesk.AutoCAD.ApplicationServices Imports Autodesk.AutoCAD.DatabaseServices Imports Autodesk.AutoCAD.Geometry Imports Autodesk.AutoCAD.EditorInput Public Class SelectionSetClass <CommandMethod("SelectWindowAndCopy")> Public Sub SelectWindowAndCopy() Dim doc As Document = Application.DocumentManager.MdiActiveDocument Dim db As Database = doc.Database Dim edt As Editor = doc.Editor Using trans As Transaction = doc.TransactionManager.StartTransaction() Dim psr As PromptSelectionResult = edt.SelectWindow(New Point3d(36, 22, 0), New Point3d(149.5, 33, 0)) If psr.Status = PromptStatus.OK Then Dim ss As SelectionSet = psr.Value ' Get the bottom-left corner of the window selection Dim windowBottomLeft As Point3d = New Point3d(35, 22, 0) For Each sobj As SelectedObject In ss Dim ent As Entity = TryCast(trans.GetObject(sobj.ObjectId, OpenMode.ForWrite), Entity) If Not ent Is Nothing Then '' Create a copy of the selected entity Dim entCopy As Entity = ent.Clone() ' Create a copy of the entity '' Calculate the translation vector to move the bottom-left corner of the entity to the origin Dim translationVector As Vector3d = New Vector3d(-windowBottomLeft.X, -windowBottomLeft.Y, 0) '' Apply the translation transformation entCopy.TransformBy(Matrix3d.Displacement(translationVector)) '' Apply the scaling transformation Dim scaleMatrix As Matrix3d = Matrix3d.Scaling(10, New Point3d(0, 0, 0)) entCopy.TransformBy(scaleMatrix) '' Open the Block table for write Dim acBlkTbl As BlockTable = trans.GetObject(db.BlockTableId, OpenMode.ForRead) Dim acBlkTblRec As BlockTableRecord = trans.GetObject(acBlkTbl(BlockTableRecord.ModelSpace), OpenMode.ForWrite) '' Add the copied entity to the block table record acBlkTblRec.AppendEntity(entCopy) trans.AddNewlyCreatedDBObject(entCopy, True) End If Next End If trans.Commit() End Using End Sub End Class I've tried researching this issue online, but I'm still unsure how to resolve it. Can anyone please provide insights on how I can properly reference the required AutoCAD libraries in my project settings to fix this error? Any help or suggestions would be greatly appreciated. Thank you in advance!
  12. 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); }
  13. So I have a VBA sub that assigns a variable to a drawing directly by its name. Trying to do the same thing in VB.NET however, it goes to an error like "Conversion from string to type Integer is not valid". Here is the code in vb.net, I have a opened autocad file named "Drawing3.dwg") and the error comes up in the last row. Dim acad As AcadApplication Dim drwg As AcadDocument acad = GetObject(, "AutoCAD.Application") drwg = acad.Documents("Drawing3.dwg") If I use this instead, it goes trough with no issues: drwg = acad.Documents(0) Now, in VBA you could either put an integer or a string with the name of the drawing in the parenthesis and it would work, in VB.NET only works with integer it looks like. I was wondering if there is another way around it without having to loop through all opened drawings and have it check the names. Thanks a lot!
  14. Is there any chance of matchline automation using lisp in layout? I have attached sample dwg and screenshot of block for matchline. Please help. And thanks in advance. SRS.dwg
  15. Hi everyone, we have already placed a block object in multiple locations. Now we need the same block in a converter rectangle array format. Is there any idea or Lisp program available?ilable
  16. Here is an example of an array that needs to be worked on and I need an easy way to count the number of rows and columns. For example, I have 3 rows and 20 columns and I need to be able to select for multiple arrays.
  17. Dears, AUTOLIPS works on the english version but i want to use it on the frensh version, any kind of support Thanks
  18. Hi all, I'm quite new to Civil 3D and I've tried to have a look online to find what I'm looking for but I feel it might be easier to just ask. I'm wanting to generate a surface model of a complex feature survey which I currently have in AutoCad. All the 3D linework for kerbs, retaining walls, footpaths etc. as well as spot heights are already in the AutoCad file (due to the nature of the project the workflow isn't very nice and predominantly involves DXFs which are then stitched into the main file and the layers are adjusted afterwards). I don't have any codes or data input workflows setup within Civil 3D. I have another survey software package that I normally use to generate my surface models but it will be very time consuming to import the DWG and set it up beforehand due to the scale and amount of breaklines so I was curious if it would be easier for me to try and do it in Civil 3D (it might not). How easy is it to take 3D polylines, splines, lines and points from a DWG and generate a surface in Civil 3D? Is it possible to select all the lines and ensure they are breaklines? Are you able to make select layers non-contourable? How easy is it to generate model boundaries? I would greatly appreciate any guidance. Regards, Ryan
  19. As I said, can I see who the autocad file belongs to? Is there any way to know if the person who delivered the file to me made this file on his own computer?
  20. Hi, there, im very new working with Autolisp, in the past i copy and paste code and use the lisp. Thanks to all the people who write this lisp. Now im learning how to code with lisp, i m reading books, developers guide and this forum. I need to understand how some commands works for use it in the lisp code. I cant find a description of how command works. For example (command "xref" "r"). But i know this command have more options, i need the description of the other options and how can i use it. (defun c:CircC () (command "._circle" "0,0" "3,3") (command "._thickness" 1) (command "._circle" PAUSE PAUSE) (princ) ) i want to know how circle command works "0,0" is the origin point "3,3" is for ??
  21. Hi guys, im looking for a quick way for change the dimension precision in multiple files. I need to change from 0.000 to 0.00 in multiple files. I dont want open each drawing and set the precision to 2 decimal. You know we look for the quick and less bored way of do things. Thanks
  22. Hi, I have thousands of drawings. They are all similar to This.dwg one. My final goal is to merge them into one kml file.. This would take months to do it one by one. If I have the right lisp to automate this in one drawing, then I can use script to run that lisp over other drawings. To reduce the result file size, I decided to keep only the green polyline in the center of the drawing(which matters the most): (defun C:foo ( / varf ins str) ; Selecting Polyline (setq varf (list '(-4 . "<OR") '(0 . "LWPOLYLINE") '(-4 . "<AND") '(0 . "POLYLINE") '(-4 . "<NOT") '(-4 . "&") '(70 . 80) '(-4 . "NOT>") '(-4 . "AND>") '(-4 . "OR>") (cons 62 3) ) ) (sssetfirst nil (ssget "_X" varf)) ; Inverting selection (if (ssget "_I") (progn; then (sssetfirst nil) (command "_.select" "_all" "_remove" (ssget "_p") "") (sssetfirst nil (ssget "_p")) ) (prompt "\nRequires pre-selection."); else ) ; Delete Selection (command "_.erase") ; And This is how I insert Drawing Name (and (or (> (getvar 'DWGTITLED) 0) (alert "Save the drawing then try again!") ) (setq ins (getpoint "\nChoose Insertion Point: ")) (setq str (entmakex (list '(0 . "MTEXT") '(100 . "AcDbEntity") '(100 . "AcDbMText") (cons 10 (trans ins 1 0)) (cons 40 0.8);Text height (cons 7 "STANDARD");Text style '(1 . "") ) ) ) (vla-put-textstring (vlax-ename->vla-object str) "%<\\AcVar Filename \\f \"%tc4%fn2\">%}" ) ) ) Now these are what I'm looking for: - I don't want to pick the insertion point manually, need to insert field inside or over selected polyline - after inserting field text, I want to explode the text. to maintain drawing name after merge. - adding a condition to check the process, if anything goes wrong, insert that drawing name at (0,0,0). this way I can track that file to check it manually. Thank you in Advanced.
  23. Hi Is there any way to export all layers separately into pdf format? i want to export all of them at once to edit them in illustrator. It's taking alot of time to export them one by one from autocad I don't have any professional Experience with programming but i have tried to made this .lisp with chatGPT but it's not working to export files which property in codes needs improvements please (defun c:ExportLayersToPDF (\Users\Useer\Desktop\pdf layers) (setq dwgname "EMERALD HILLS MP (2007) 25 01 2023") ; (setq dwgpath "F:\Shahtaj Ahmed Bhutto\AUTOCAD") ; (setq layname "") (while (setq layname (tblnext "LAYER" layname)) (and layname (/= layname "0") (/= layname "DEFPOINTS") (/= (logand (cdr (assoc 70 (tblsearch "LAYER" layname))) 1) 1) (progn (setq pdfname (strcat dwgname "_" layname ".PDF")) (setq pdffullpath (strcat dwgpath pdfname)) (command "-plot" "Yes" "Model" "" "" "DWG To PDF.pc3" "A0" "PORTRAIT" "Inches" "Fit" "Center" "No" "No" "No" "Yes" "No" "No" "Yes" "Yes" pdffullpath) T ) ) ) (princ) )
  24. Hello guys, I am new to this forum. I need LISP for Selection of alternate lines from the selection set of lines like 1st, 3rd, 5th, .....etc lines in Autocad. I am attaching the file with my requirement. Alternate Selection of lines.dwg Please help me out with an possible lisp solution. Also, Is there a Autocad Plugin to do this? If so Please share the link Thanks in advance, Pranesh Rathinam
  25. So i make some lisp-cover them to fas. Put all in 1 folder and make 1 mnu file that load with menuload and load all that lisp. But now i want put that in USB and when i load it to autocad, whatever i click in any lisp i want password showup then when i enter password i can use all fuction of it. Every time i open autocad and use them i need reenter password. Any change i can make that?
×
×
  • Create New...