Search the Community
Showing results for tags 'autocad'.
-
I would like some help to create a function that would allow me to select a point in between two horizontal and/or vertical lines and it would give me the vertical and horizontal dimensions between those lines. It's a 2D drawing but some lines are of different z value. I have tried using chatgpt to create a code but it is not able to properly select the nearest line from my specified point (after running the command). This function is there in the new sketchup. I was hoping to use it to create internal dimensions in an architectural plan.
-
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
-
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
-
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.
- 8 replies
-
- autocad
- change language
-
(and 1 more)
Tagged with:
-
Is There Any Way To Export All Layers Separately Into Pdf Format?
Shahtaj Bhutto posted a topic in Tutorials & Tips'n'Tricks
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) )- 10 replies
-
Wish to separate similar blocks to assign different layers
TomKaner posted a topic in AutoCAD Drawing Management & Output
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 -
Dimensions are not visible. They appear only when I zoom in on the drawing. My AutoCAD version is 2009.
- 10 replies
-
- autocad
- autocad dimension
-
(and 1 more)
Tagged with:
-
find the dimension and polyline distance using AUTOLISP
keku posted a topic in AutoLISP, Visual LISP & DCL
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 -
Civil3D and AutoCAD skills required in the oil & gas industry.
PaddyFoodie posted a topic in Civil 3D & LDD
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 -
Insert a block at multiple points or lines and scale
grouch19 posted a topic in AutoLISP, Visual LISP & DCL
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 -
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
-
Conversion from string to type Integer is not valid
Musashi84 posted a topic in .NET, ObjectARX & VBA
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! -
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
-
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?
-
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!
-
if condition not working in delete circles using diameter
ajithkumar.t posted a topic in AutoLISP, Visual LISP & DCL
(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.. -
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); }
-
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
-
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
-
To calculate the number of rows and columns in an array, need Help
Tamim posted a topic in AutoLISP, Visual LISP & DCL
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. -
Dears, AUTOLIPS works on the english version but i want to use it on the frensh version, any kind of support Thanks
-
Creating a surface model in Civil 3D from existing 3D polylines, lines and points
0misclose posted a topic in Civil 3D & LDD
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- 2 replies
-
- surface modelling
- civil 3d
-
(and 2 more)
Tagged with:
-
autocad Can I see who the autocad file belongs to?
memento posted a topic in AutoCAD Beginners' Area
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? -
where can i find the "commands" and how it works in lisp
ASQ posted a topic in AutoLISP, Visual LISP & DCL
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 ?? -
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