Jump to content

Search the Community

Showing results for tags 'autocad'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • 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


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

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...

  1. G'day all I'm working on and editing a mapping project from photogrammetry. I have a block which indicates a square manhole cover. (File is attached to this post) My project area has hundreds of these manholes and my client needs each of them scaled and rotated to fit the exact size of the manhole. I had been manually doing this with the help of an ECW image in the background. But the process is rather tedious and not all that accurate. My operators can pick up a three point string showing the height and length of the manhole. Some manholes are square and some are rectangular. I have a few lisp routines that get the block in there. The block insertion point comes in at the first plotted point as required. Is there any similar LISP that will insert the attached block dwg file at the first point collected and scale it based on the 2nd and third point whilst keeping the elevation heights? I've attached two dwg files... One is the block itself and one is a diagram with a better explanation. I've also added a screen shot of what is required. Any help would be appreciated Cheers guys Manhole.dwg BlockSample.dwg
  2. 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
  3. 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!
  4. 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
  5. 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?
  6. 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!
  7. (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..
  8. 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); }
  9. 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
  10. 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
  11. 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.
  12. Dears, AUTOLIPS works on the english version but i want to use it on the frensh version, any kind of support Thanks
  13. 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
  14. 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?
  15. 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 ??
  16. Dear all, I just switched workplace with one of my colleague and she had been using a Chinese version of Autocad. How do I switch it back to English? I searched in the startup menu for "AutoCad 2013 - English" but it was no where to be found. I certainly don't want to go into all the hustle of finding the original installation disk or anything like that.. Please advice.
  17. 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
  18. 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.
  19. 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) )
  20. 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
  21. Hello everyone, I have one issue with dimension properties where I want to know if something can be done. We work with meters as units, and we make a lot of details so we've found a format that suits our needs but it means a lot of manual overrides. Basically, the dimensions are to be displayed with meters as the units, and we have the two first decimals for the cm as is, but we write the next or next two decimals for the mm range as superscript, stacking the last two digits. Is there any way to have the precision set to .0000 and stack the last two digits as default as opossite to manually override each dimension? Thanks in advance!
  22. 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?
  23. Hii all...I found a multiline polyline lisp from online, its gonna ask how many line and their offset distance...but its assigning layer automatically, can anyone do the changes so it will ask which layer I want to choose for my each line and it should automatically take the linetype as by layer...if I am choosing even no. of line, then the path I am drawing its automatically think that as center line and offset the distance, can anyone makes changes so it will make one line in my drawn path and ask me in which side I want to allocate how many line... multi line.lsp
  24. hello i want help for creating lisp for me please ... the lisp will do these functions 1- as the attached image (1a) if i have block with yellow at right and some green blocks 2- i want when i launch the lisp to ask me to draw poly line that i want as in image 2a 3- after that when i draw this path with polyline and press enter the lisp ask me to choose blocks that i want to connect to this polyline and i will choose one by one or multiple blocks then after choosing the blocks and press enter ... the lisp will offset the main polyline that i draw and connect every polyline with the basepoint of the blocks that i choose sequentially as appear in this image 5a (attached DWG) can anyone help me please sample.dwg
  25. Hi! I have this code that i found here in the forum it was created by @rlx. My question is how to add an automatic current date and time to the end of the file when im saving it. Many thanks! xoxo (defun c:foo (/ _dir F NF P SF SH) (defun _dir (msg path / sh folder out) (or (vl-file-directory-p path) (setq path (getvar 'dwgprefix))) (cond ((and (setq sh (vlax-get-or-create-object "Shell.Application")) (setq folder (vlax-invoke-method sh 'browseforfolder 0 msg "&H2000" path)) ) (setq out (vlax-get-property (vlax-get-property folder 'self) 'path)) (setq out (strcat (vl-string-right-trim "\\" out) "\\")) ) ) (and sh (vlax-release-object sh)) out ) (if (setq p (_dir "Pick a directory yo!" "E:\\Autocad Files\\SSC\\North Region\\SNE\\")) (progn (setq f (getvar 'dwgname)) (setq sf "Plans") (setq nf (strcat p sf "\\" f)) (cond ((cond ((findfile nf) (print "File exists...") nil) ((vl-file-directory-p (strcat p sf)) (vl-file-copy (strcat (getvar 'dwgprefix) f) nf) t) ((vl-mkdir (strcat p sf)) (vl-file-copy (strcat (getvar 'dwgprefix) f) nf) t) ) (setq sh (vlax-get-or-create-object "Shell.Application")) (vlax-invoke-method sh 'open nf) (vlax-release-object sh) ) ) ) ) (princ) ) (vl-load-com)
  • Create New...