Jump to content

Search the Community

Showing results for tags 'vba'.

  • 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 can anyone here help write a lisp routine that can be run project wide to hide/show attributes . The user must be given an option to select an object , write or select attribute name and also select multiple drawings from the project. I have a code that updates the attribute value , attaching that - Please help change that to hide/show attributes updateATTRIB.lsp
  2. I found valuable lisp for auto creation block. I want to improve this lisp to following requirement * block selected object individually, not in one block thanks AUTO-BLOCK.LSP
  3. Hello Community! I have been researching this for some time, I am trying to know if it is possible through a routine (lisp) to transfer / copy the information from LT (link template associated with a database in access) to the OD (object data) as I show in the image. So i need a very specific Lisp/VLisp/VBA/Dotnet routine who asks for : -- The Link Template DB name -- Which DB fields are you interested for -- Which OD Table MAP to fill -- Which OD Fields MAP to create or to use (if already existing) -- Selecting objects -- Retain only objects which the correct parameters -- ACTION ... Copy Data to OD fields ... append DWG & MDB files as example. thanks for the help you can give me, greetings EJEMPLO.zip
  4. NirantarVidyarthee

    Wrong value of ExtMin

    I have received the attached drawing from one of my clients. (I have removed geometry to maintain confidentiality. But it retains the essence of problem that I have). I have to write VB/A program that extracts data from this drawing. For that I need to know the extents of the drawing. The system variable ExtMin shows a value of X (98331) which is greater than the X (92817) of min. point (left bottom corner of the border) of existing geometry. I have tried everything (purge, overkill, audit, recover) but can't find a way to correct the value of ExtMin. Assuming that this drawing is corrupt and can't be recovered, then I have another problem. How can I programatically find that the ExtMin value of this drawing is wrong and hence this drawing is corrupt. ExtMin Problem.dwg
  5. Good day everyone, I like to merge three blocks attributes to one block with attributes. I'm not good at VBA. I hope someone correct the below code for me. Thanks Public Sub Merge_LnBLk() Dim ss As ZcadSelectionSet Dim UNode As ZcadText Dim UGL As ZcadText Dim UIL As ZcadText Dim DNode As ZcadText Dim DGL As ZcadText Dim DIL As ZcadText Dim LnLen As ZcadText Dim Size As ZcadText Dim GetPt As Variant Dim BlkName As String Dim NodeBlk As ZcadBlockReference Dim FromBlk As ZcadBlockReference Dim ToBlk As ZcadBlockReference Dim SizeBlk As ZcadBlockReference Dim objAttribs As Variant Dim FromobjAttribs As Variant Dim ToobjAttribs As Variant Dim SizeobjAttribs As Variant On Error Resume Next ThisDrawing.SelectionSets("s").Delete On Error GoTo 0 Set ss = ThisDrawing.SelectionSets.Add("s") ss.SelectOnScreen Set FromBlk = ss.Item(0) Set ToBlk = ss.Item(1) Set SizeBlk = ss.Item(2) GetPt = ActiveDocument.Utility.GetPoint(, "Pick where the block to be inserted") BlkName = "LNNode" Set NodeBlk = ActiveDocument.ModelSpace.InsertBlock(GetPt, BlkName, 1, 1, 1, 0) FromobjAttribs = FromBlk.GetAttributes() UNode.TextString = FromobjAttribs(0) UGL.TextString = FromobjAttribs(1) UIL.TextString = FromobjAttribs(2) ToobjAttribs = ToBlk.GetAttributes() DNode.TextString = ToobjAttribs(0) DGL.TextString = ToobjAttribs(1) DIL.TextString = ToobjAttribs(2) SizeobjAttribs = SizeBlk.GetAttributes() LnLen.TextString = SizeobjAttribs(0) Size.TextString = SizeobjAttribs(1) objAttribs = NodeBlk.GetAttributes() objAttribs(0).TextString = UNode objAttribs(1).TextString = UGL objAttribs(2).TextString = UIL objAttribs(3).TextString = DNode objAttribs(4).TextString = DGL objAttribs(5).TextString = DIL objAttribs(6).TextString = LnLen objAttribs(7).TextString = Size NodeBlk.Update End Sub TestBlocks.dwg
  6. 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!!
  7. 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"
  8. 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
  9. 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.
  10. Cleyton Ramos

    Instersectwidth

    Hello! I'm having trouble getting the intersection points on a straight line. Can you post a simple example? thankfull
  11. 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!
  12. 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
  13. Hi to all, please somebody know how to manage the ampoweredit functionality and related dialog windows by VBA personalizzation ?
  14. 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
  15. 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!
  16. 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
  17. 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!
  18. 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
  19. 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
  20. 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!
  21. 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
  22. 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
  23. 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!
  24. 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
  25. 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
×
×
  • Create New...