Jump to content

Search the Community

Showing results for tags 'vba'.



More search options

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

  1. I am using AutoCAD VBA with array. I need to call a LISP function to pass a parameter (array). How can I the pass an array from VBA to LISP? I am using this expression: ThisDrawing.SendCommand "Myfunction"
  2. NBCAD

    OBJECT DATA ASSIGNEMENT

    Hello, As part of a project I must assign an object data table to all elements of the drawing according to their layer. I am looking for an automated solution to assign the Objects Data tables to the elements of the drawing other than by selecting the different layers one by one. Knowing nothing in programming, I ask you to find ways to achieve this result. On the other hand, once the object data tables (Object data) assigned to the various elements I want to find a way fast enough to copy some attribute objects in the corresponding "Object Data" fields. For example copy the value of the orientation of a block (Attribute Value "Rotation") in the corresponding OD field (Attribute Value "ARE_ORIENT"), as in the attachment. I am currently doing these manipulations by hand and this is a huge waste of time. I am interested in any solution as small as it is! Thank you!!
  3. katto01

    VBA delete object

    Hello, I have a drawing with about 15000 objects. I would like to delete all objects with a volume smaller than Vx. I cannot see all objects, I can access them through VBA. I generated a list of objects and extracted the handle and the maximal dimensions. Therefore, I know by handle which object I want to delete. What is the VBA command to delete an object defined by its handle? If this approach cannot be implemented, please suggest alternatives Thank you
  4. Cleyton Ramos

    Get info from insertblock

    Hello! How do I get the information from an insertblock by clicking it? Thank you very much in advance.
  5. Cleyton Ramos

    Instersectwidth

    Hello! I'm having trouble getting the intersection points on a straight line. Can you post a simple example? thankfull
  6. Anyone has a code to accomplish this? I am dealing with bunch of poorly converted lines from PDF that used to be AutoCAD text in the drawing. Greatly appreciated!
  7. Hello Anybody Help. I need to get point from spline with use lisp function in autocad vba vlax-curve-getPointAtDist Could somebody can help me? Best Regard Joe
  8. Hi to all, please somebody know how to manage the ampoweredit functionality and related dialog windows by VBA personalizzation ?
  9. Hi, I'm new to AutoCAD. I have 700 drawings in AutoCAD. I have to enter "Checker" value in the drawing title block. For all the drawings, its the same value. How to I automate this? I don't want to open manually individual drawing and fill the value. Any macro available for this? Please help. Regards, Prasanna.A
  10. Hello, I am trying to create a dimension style using VBA Excel. I have a simple code as follows: Option Explicit Sub New_Layer() Dim acadApp As AcadApplication Dim acadDoc As AcadDocument Dim mSp As AcadModelSpace Dim dimstyle As AcadDimStyle Dim sDim As AcadDimAligned Dim point1(0 To 2) As Double Dim point2(0 To 2) As Double Dim location(0 To 2) As Double 'Check if AutoCAD is open. On Error Resume Next Set acadApp = GetObject(, "AutoCAD.Application") On Error GoTo 0 'If AutoCAD is not opened create a new instance and make it visible. If acadApp Is Nothing Then Set acadApp = New AcadApplication acadApp.Visible = True End If 'Check if there is an active drawing. On Error Resume Next Set acadDoc = acadApp.ActiveDocument On Error GoTo 0 'No active drawing found. Create a new one. If acadDoc Is Nothing Then Set acadDoc = acadApp.Documents.Add acadApp.Visible = True End If Set mSp = acadDoc.ModelSpace 'Dimension points point1(0) = 0#: point1(1) = 5#: point1(2) = 0# point2(0) = 6.1: point2(1) = 5: point2(2) = 0# location(0) = 5#: location(1) = 4.4: location(2) = 0# 'Add dimension Set sDim = acadDoc.ModelSpace.AddDimAligned(point1, point2, location) 'Set dimension properties sDim.Color = acByLayer sDim.ExtensionLineExtend = 0 sDim.Arrowhead1Type = acArrowOblique sDim.Arrowhead2Type = acArrowOblique sDim.ArrowheadSize = 0.1 sDim.TextColor = acGreen sDim.TextHeight = 0.2 sDim.UnitsFormat = acDimLDecimal sDim.PrimaryUnitsPrecision = acDimPrecisionOne sDim.TextGap = 0.1 sDim.LinearScaleFactor = 100 sDim.ExtensionLineOffset = 0.1 sDim.VerticalTextPosition = acOutside 'Create a new dimension style Set dimstyle = acadDoc.DimStyles.Add("D100") 'Copy dimension properties from previously added dimension dimstyle.CopyFrom (sDim) 'Delete dimension sDim.Delete End Sub However dimstyle.CopyFrom (sDim) line does not working. I am getting following error: "Object doesn't support this propert or method" I couldn't find what I am doing wrong. I am using AutoCAD 2013 and Excel 2016. Thank you!
  11. selvamani

    Printing Customization

    Hi All, I need help in customizing printing cad files actually in my case single drawing would have multiple sheets in single model space so it will have multiple title block is there any way to print entire region inside title block one by one by means of vba scripting? (i mean is there any way to sense outer boundary of title block in vb and set it as printing area) Having thousands of cad files in which work area in model space of any two drawing is not same thanks in advance Drawing2.dwg
  12. My VBA application requires info from one drawing to be used in another one in the same VBA running session. I need to ALIGN one drawing based upon 3 3D points from another draiwng automatically. At the moment I'm running my application to collate the info from drawing 1, store it, close my application to open the other drawing and run my application again to retrieve the info to ALIGN it. Any idea how I can switch to another loaded drawing in the same VBA running session? Thanks!
  13. Is it possible to exclude from a vba macro for Autocad a specific region? For example, apply this macro not to all modelspace but only to a part (which has not lines as boundaries but defined only by position reference x,y in autocad). Thanks
  14. ElCidCampeador

    VBA Autocad: How to find lines?

    I'm trying to write a VBA code that searches in a general drawing all lines that have a specific length and slope. Then, every time it finds that line in the drawing, it will write next to a specific text, for example "line". Do you think it's possibile? Any idea? Thanks
  15. ElCidCampeador

    Recognize multi-object shape

    Hi, I converted a pdf file into dwg. In this new file a point has become a group of 2D polyline and not a sigle entity. This conversion is necessary because I have to work in autocad. My problem is that I have to search in this dwg all of this "points" and write a text next to. Is possible to write a VBA program for autocad able to do this? If the point was a single point, it wouldn't be a problem, but in this case...I dont' know!
  16. Hi First time poster here. I've only got AutoCAD13 and there's almost no chance for us to get civil 3d. But I have a 4km pipeline i'm trying to model so I'll need a longsection. Besides doing it manually is there a more efficient method, given the contour file I have is at 0.5m intervals. I'm thinking even a script in Excel that pulls the intersect for the pipeline polyline and contour lines and return the x-y-z coordinates. Thanks
  17. Hi everybody, I have a big problem.... I have about 100 DWG with a lot of sheet in the same model space and i must print every sheet, so i am looking for a script in VBA or lisp to create from multiple areas to plot in model space, a layout tab for each area vba autocad. I found a lisp script, but it doesn't run (plotDWGarr). (http://www.cadforum.cz/cadforum_en/plotting-a-series-of-drawing-frames-composed-in-a-dwg-drawing-tip7585) Do you know another similar script o to write a VBA to do it? Thank you very much in advance
  18. Hi Everybody, Via the command area it is possible to retrieve the surface area of a solid body (Acad3DSolid). Unfortunately the area it is not a property of a solid body so I'm haveing difficulties retrieving the surface area (which I want to write to an excel file). I've tried to explode the solid which results in several regions and surfaces. Unfortunately only the regions have an area; the (curved) surfaces don't. Anybody suggestions how to get the area of some solids useing VBA? Looking forward to the suggestions!
  19. I met a very "strange" behavior of VBA with Fillet Command send via ThisDrawing.SendCommand function. I have the function Fillet_2Line (line1, line2, r), which will apply the Fillet command to line1, line2 with Radius=R Sub fillet_2line(line1 As Variant, line2 As Variant, radius As Double) Dim text As String text = "f" & vbCr & "r" & vbCr & radius & vbCr & "(handent " & Chr(34) & line1.Handle & Chr(34) & ")" & vbCr & "(handent " & Chr(34) & line2.Handle & Chr(34) & ")" & vbCr ThisDrawing.SendCommand (text) End Sub As you can see, the function is very simple, call Fillet command from Autocad then select two lines by their handle. Use can reproduce the function without VBA by call Fillet command and select two POLILINES by their HANDLE. However, it works on LINE, but NOT POLYLINE. If I select two polylines by left click on them, it works. But if I select two polylines by their HANDLE, it does not work! Fillet 2 Line - Selected by left click - Works Fillet 2 Line - Selected by handle - Works Fillet 2 PLine - Selected left click - Works Fillet 2 PLine - Selected by handle - Does not work
  20. Hello, I'm a new user about autocad and new user about this Forum. I try use VB and CAD... Is there a solution for my problem in object? i just write code for MSGBOX: Dim Variabile As Integer Variabile = MsgBox("Hai esportato i parametri?", vbOKCancel) If Variabile = 2 Then ActiveWindow.Close and work if use a macro....but for insert this message when close a file? can i make a particular macro for this like excel or access??? thanks for You interest
  21. Hi There Sorry that this will be such a basic question. I am not a VBA expert in any way....quite new actually . Running Autocad Architecure 2014. I have a VBA utility that I have made a special button for. I want this button to insert a dynamic block. I have WBLOCK'ed the block and it is in a nework folder - no issues here. There are several other snippets of VBA code that I have found online (even from this forum) and have tried to modify them to work. I must be doing something wrong, as it always stumbles within the code or silently sits there doing nothing. I just want to click this button and my dynamic block (from network) will be brought into the existing drawing, and the user will select insert point and direction..... Mouse click...done....block inserted. Similar action to a block that would be brought from a tool pallette (but has to be from this VBA utility) Any help would be appreciated. Matt
  22. Hi Everyone I know this and similar questions have already been posted in many forums, and before you start copy pasting links of other threads, you have to know that I probably have seen them already and none of them is 100% perfect answer to what I am trying to achieve. And now I will describe my situation and my issue. I am a REVIT guy but I recently started a new job in an office that uses primarily Autocad. I am currently in the process of creating office standards. The problem is that it does not happen over night. At the moment I am mainly relying on (dynamic) blocks. As I keep creating them, I save them in a template file - let's call it "XYZ". We currently have 40-50 active projects. Some new, some old. When I myself am working on a project - what I do is "copy/paste" all the blocks from the XYZ file so i can use them in the currently open project. The problem is that my colleagues are either stupid enough not to know or remember (how) to "copy/paste" the blocks or are just so lazy that can not be bothered (completely unpleasant environment). So what I want to achieve is: whenever someone opens an Autocad drawing, to have all the blocks from the "XYZ" file already loaded. Or alternatively have all the WBLOCK files loaded from a specific directory like c:\Autocad\abcd... Bear in mind that this is not 1 time thing that needs to be performed on all the active project drawings. I keep creating new blocks every day. Please do not respond with "This can be achieved by....". I am looking for a way not to have anyone do anything, but Autocad do all the work. I would much rather be satisfied with "This cannot be achieved" answer, rather than having people enter JUST a few commands to get it done. My colleagues are stupid and they won't press an extra key to get the blocks loaded. I would be really grateful if anyone can help me. If not, nothing changes, I have already lost faith...
  23. Hi, I need to extract Information ("General": Color, etc. and "Geometry": Length, Start Y, End X, etc.") from AutoCAD to an Excel-Sheet using VBA. First I've tried it manually in AutoCAD with the commands DATAEXTRACTION and EATTTEXT and it works. Also I've tried entering in VBA "SendCommand ("DATAEXTRACTION" & vbCr")", then an AutoCAD-window is opened and I have to click on "Next" several times and to specify the folder where I want to save the file. I want that VBA does all this process without the window appearing (I mean "without clicking on "Next" several times and specifying the file path"). Obvious the User has to Input into the code the location where he wants to save the file with the extracted information). Instructions als "For Each Object in ModelSpace: Line.StartPoint, Line.Color, etc." don't help me unfortunately because this way slow down the VBA-program. May anyone help me? Thanks! Regards,
  24. hello evryone , i'm looking to make a VBA code to get a setected coordinate point (x,y and Z) directly to excel sheet . thank you for your help
  25. Hi! I would like a macro which will add a text attribute from an x-ref file to another block attribute which is up to 1.5m around the x-ref element. example: Attribute block: WF-PC-L2.0-095 X-REF attribute: L2.0-0368 I' d like to add L2.0-0368 to WF-PC-L2.0-095. The distance between the 2 attributes is no more than 1.5m perimetrically. I guess coordinates can be the common reference, but i am not faamiliar with coding..
×
×
  • Create New...