Please help me how to code 3d align in vba.
I want to select all circle form the active drawing so I have found the code as mentioned below from "acadauto.chm" which is used for Active VBA reference programming.
' Create the selection set
Dim ssetObj As AcadSelectionSet
ssetObj = objAcadDoc.SelectionSets.Add("SSET")
Dim gpCode(0) As Integer
Dim dataValue(0) As Object
gpCode(0) = 0
dataValue(0) = "Circle"
Dim groupCode As Object, dataCode As Object
groupCode = gpCode
dataCode = dataValue
ssetObj.Select(AcSelect.acSelectionSetAll, , , groupCode, dataCode)
and I am getting the error as mentioned below : 2nd & 3rd arguments were optional so I don't want that
Invalid argument FilterType in Select
Can anyone tell me what is the wrong with this code ?
Was wondering if anyone could help with this idea.
Would like to have a vba to insert pdf’s;
Here is what I would love to know how to do. “oh, I only have a little vba knowledge”
1) Would to have an excel spread sheet that has a list of block or pdfs ” block/pdf name”, “path”, and “scale”,
2) Have an interface that would prompt a user for a folder name say named “details”
3) Have an interface that would list block/pdf’s that it pulls from the excel spread sheet, than copies the selected dpf/block to details folder
4) Than insert pdf/block from that folder at a select point.
Have no idea if this is due able, to me sounds like a huge task, but if someone can get me started
I’m sure if could come up with something that works better that what I doing know.
in autocad block 4 line TXT
TXT1 (handle # 3)
TXT2 (handle # 2)
TXT3 (handle No. 4)
TXT4 (handle # 1)
When I recuper the string in a combobox it puts me in the order of handle
I then I want in the order of the line screen TXT1,2,3,4
Thank you for your help
Dans le bloc autocad 4 lignes de TXT
TXT1 (handle N°3)
TXT2 (handle N°2)
TXT3 (handle N°4)
TXT4 (handle N°1)
Quand je recupere le string dans une combobox il me le met dans l'ordre du handle =>Ligne 4,2,1,3
alors que je je veux dans l'ordre de l'écran ligne 1,2,3,4
Merci pour votre aide
Here is a full video explanation of the problem: http://youtu.be/A0URVFPSoHs
It begins by throwing up the Autocad Help.
Then Shows a message that says "Could not load an object because it is not available on this machine"
Then I get a message like this
I have a VBA batch macro that is causing a problem. Here is what the macro does:
1. Displays a form that allows the user to select a folder.
2. Populates a list box on the form with all drawings in the selected folder.
3. In batch mode:
3.1 Opens a drawing listd in the list box.
3.2 Collect valies of all attributes and stotr them in variables.
3.3 save the drawing (as AM2008) on the server.
3.4 Delete the drawing from the ptiginal location.
3.5 Write attribute data to MS Access 2007 database (located on Server).
3.6 Go back to step 3.1 until all drawings are processed.
I get the following error after exactly 3 drawings are processed.
Runtime error-2147417856 (80010100) Automation Error
System Call Failed.
The code that causes this error is:
Set dwgToProcess = acadApp.Documents.Open(lstFiles.List(i), True)
How can I overcome this this error?
I'm new to autocad and not familiar with autocad object model (but I have done a lot of vba for other drawing programs).
I need to export an entire dwg file to small tiles (each a png file, so I can later on overlay on google map).
Logically, I need to:
1. programmatically zoom to a small bounding box.
2. programmatically cut and export each to a png.
These steps need to repeat for each resolution level (matching googles' zoom level).
Could anyone shed some light on this, thanks a lot.
NOTE: reposted from AutoCAD 2013/2014 forum.
I have a VBA (from Access) application that currently runs in Windows XP and Microsoft Access 2003 and AutoCAD 2009. It opens AutoCAD via:
Dim acadApp As AcadApplication
Set acadApp = CreateObject("AutoCAD.Application")
In the current environment I open a DWG, process it, and close it. It typically runs at 50-60% CPU utilization (both Access and AutoCAD) on a dual processor system.
I now have Windows 7 (32 bit), Access 2010 (32 bit), AutoCAD 2014 (32 bit). It runs around 3-4% CPU utilization (both Access and AutoCAD) on a quad processor system. It takes approximately 10x longer to process in the new environment. However, it does eventually complete.
XP machine is laptop Dell Latitude D630. Dual Core 777 MHz, 2 GB of RAM.
Win 7 machine is laptop Dell Latitude E6430. Intel i5-3230M Quad Core 2.5GHz, 4 GB RAM.
Both are 32 bit OS.
The machine that is much faster, running AutoCAD 2014, is much slower running my application.
The issue I'm wondering about is why the Win 7/Access 2010 & AutoCAD 2014 CPU utilitzation is around 5%, with the rest (95%) idle? I checked task manager. It showed the priority as Normal. I changed them to High, but still they ran no faster.
Any ideas what may be slowing it down? Thanks.
add/create render materials to current drawing file using VBA code. Can I have any sample code?
attach the materials to the solid/blocks using VBA code. Can I have any sample code?
I like to draw line perpendicular to line using vba. Anyone have sample code?
I like to create leader on paperspace using vba. I have code for creating leader. I can’t pick solid edge using vba code, Anyone have sample code?
Hi to every one,
I'm new in this post and my problem deal with the setup of Autocad VBA Enabler.
After installing < AutoCAD_2014_VBA_Enabler_English_Win_64bit>, I found that a new folder < AUtodesk> was created in my root C:\
Clearly, the installation path is < C:\Autodesk\AutoCAD_2014_VBA_Enabler_English_Win_64bit_dlm >.
Every thing work very weel. !!
but I'm worried: how does my application Autocad know that I installed a VBA Enabler? wich files connect the two application? :smileymad:
Thank you for your explanations
I have a routing that creates Page Setup or Plot Configurarion.
Thisdrawing.PlotConfigurations.Add "TempPlot", False
It create a plot configuation fine, but how do I set it as current.
Good day to all AUTOCAD VBA MASTER
Bad news I'm a new in VBA ( So please help me to finish this project)
i have a block in model space and a single line.
question: How i can extrude this block?, the height of extrusion is the length of the line?
Please if can provide sample form and codes
thank you very much
I don't think there is a method to record mouse clicks and keyboard strokes to a VBA then have it replay from Excel VBA or so.
I'm using VS2013 (VB) and Autocad 2010 to write some code to prepare (ie. setting the drawing size, orientation, layers on/off, config name etc.) some drawing files before using Adobe PDFMaker to make pdfs. During testing, we noticed that if a Layout (Layout1) has been activated by simply clicking on the tab, it will be included in the pdf. In other words, we get one sheet for the “Model” and one sheet for “Layout1” in the pdf. If the Layout1 tab has never been clicked in a drawing, we get one only sheet in the pdf representing a printout of “Model”. We only want the printout of the “Model” as we do not utilize Layouts for printing.
I would like to iterate through the layouts and delete everything except the “Model”. When trying to delete “Layout1”, an error is thrown saying “Unable to set current layout”. I think if I could set the “Model” as current, the “Layout1” could be deleted. So my question is how to set “Model” as the current layout so I can delete “Layout1”. OR… I am I going about this wrong? Is there a way to de-activate a Layout tab once it has been clicked. I looked to see what gets “activated”, but I can’t tell.
I have searched many Autocad forums and found examples of how to set a Layout as current or active using VLISP. I also found examples in VB, but they were not using ObjectDBX. They all used an active session of Autocad.
Any help would be greatly appreciated.
Here is a condensed version of the code:
Dim AxDbDoc As AxDbDocument
Dim objACApp As AcadApplication
objACApp = Nothing
On Error Resume Next
objACApp = GetObject(, "AutoCAD.Application.18") 'acad 2010
AxDbDoc = objACApp.GetInterfaceObject("ObjectDBX.AxDbDocument.18") 'acad 2010
AxDbDoc.Open(strFileName) 'Open the drawing
'**** Set up the drawing for making the PDF ****
'Delete all Layouts (except Model)
For j = AxDbDoc.Layouts.Count - 1 To 0 Step -1
If AxDbDoc.Layouts(j).Name.ToString <> "Model" Then
AxDbDoc.Database.Layouts(j).Delete() <== THIS IS WHERE IT ERRORS WITH “LAYOUT1”
'define layer settings here
'define plot settings here
AxDbDoc.SaveAs(AxDbDoc.Name) 'save the file
I 've created palettes to share with other users. I can use AutoCAD options to declare where I save the palettes, and tell all users to modify AutoCAD options to use this directory. So, if I modify or add palettes, when you launch AutoCAD you automatically load the palettes in this directory, This is very parctical to automatically update palettes on users workstations, but this mean ALL the palettes are loaded !
What I try to do is to have a directory containing all the palettes (xtp files), where users can choose those they whish to use. If this directory is modified (add or modify xtp files), when you start AutoCAD your palettes are updated. But only the palettes you use on your own computer, without requiring you to load all the palettes in the directory.
Any idea ?
I have seen posts that say this works and some that say it doesn’t. Anyone have any direct experience with it. I haven’t gotten it to give any output. The report works fine using the Automatic report interface.
This is my report:
Report = Panel Bill of Material (TAG_PBOM)
Format = (16 28 2 3 20 21 (7 4 3 8 9 10 11 12 13 14 ))
Title = ("ITEM" "N/A" "QTY" "CATALOG" "MFG" "ASSYCODE" "DESCRIPTION" "DESC" "QUERY2" "QUERY3" "MISC1" "MISC2" "USER1" "USER2" "USER3" "TABNAM" "TAG" "DESC1" "DESC2" "DESC3" "INSTALLATION" "LOCATION" "UM" "MOUNT" "GROUP" "HDL" "DWGIX" "REF" "SHEET" )
Characters = (12 4 4 60 24 24 60 60 60 60 60 60 24 24 24 32 24 60 60 60 24 16 60 24 24 18 12 12 12 )
Justification = ("R" "L" "L" "L" "L" "L" "L" "R" "R" "L" "L" "L" "L" "L" "L" "L" "L" "L" "L" "L" "L" "L" "L" "L" "L" "L" "L" "L" "L" )
Sorting = (17 17 17 17 )
Output File Type = XLS
Output File Name = "C:/Autocad Electrical Report Output/BOM.xls"
Include Options = ("1" "0" "1" "1" "1" "1" "0" "1" "1" "0" "0" "0" "0" "0" "" )
Location Options = (1 nil )
Installation Options = (1 nil )
This is my report group:
"Panel Bill of Material","C:/Users/Timothy/AppData/Roaming/Autodesk/AutoCAD Electrical 2014/R19.1/enu/Support/user/Panel BOM.set",x,nil
This is my code:
ThisDrawing.SendCommand "(c:ace_auto_rpt PanelBOM.rgf nil nil)" & vbCr
This is the command line output:
Command: (c:ace_auto_rpt PanelBOM.rgf nil nil)