I have this vba code that created in 2009 autocad 32 bit environment. I am fixing it so it will work for the 2013 autocad civil 3D 2013 64 bit environment.
The code work fine in the old vision but keep on crushing in the new one . I fixed the references and also move up the search path to the top, but it showing compile errors or runtime errors like the following.
if you ignore that error and run it agin it will go to the next step and show you another errors. after a few rerun it will give the result.I try fix it with an older vision library of autocad 2009 and 2012 both gives an run time error message.
I have been using a dialog box with checkboxes for creating layers for the past 5 years now with minimal problems. I don't know much about VBA code, but when there is a problem, I can usually figure out what is going on, which is generally a typo the causes it to error. The code was created by an employee that left the company about 3 months after I started.
After installing acad 2013 and the VBA enabler this code only partially works. It will create the layer in the drawings, but will not set the color, linetype or the description. When I click on the checkbox for any of the layer checkboxes I get a "Run-time error '13': Type mismatch" error. I click on the "Debug" button which opens VBA, the "This Drawing.Layers.Add" line in the below code is highlighted.
As a troubleshooting effort, I tried retyping the ".Color" line, when I had typed out "m_refg_pipe_n." a drop-down box appears, but "Color" is not an option anymore. The only color option in the list is TrueColor, which we do not use. In the next line of the below code, "Description" is an option. So I am guessing that the ".Color" line of code is the problem.
Private Sub CheckBox101_Click() Dim m_refg_pipe_n As AcadLayer Set m_refg_pipe_n = ThisDrawing.Layers.Add("m-refg-pipe-n") m_refg_pipe_n.Color = acGreen m_refg_pipe_n.Linetype = "Hidden" m_refg_pipe_n.Description = "MN - Refrigerant Piping" End Sub
I am upgrading the AutoCAD 2009 X 32 systems to the 2013 X64, and I have this vab code that won't work on the new system. I try to move the search path that contain the file up to the top and also got all the missing libraries, but the code still won't work.When I run the code it will give me error message like: compile error:
Function or interface marked as restricted, or the function uses an Automation type not supported in Visual Basic. The code work perfectly without any error on the old system so I sure the code is causing this error.
Is there any possible way to enter a G Code into AutoCAD to end with the result of a 2D drawing of what my CNC has made? I have the code from the machine, and am not sure how to input it into the program to draw the face the CNC has cut out.
I am copying chunks of code from the My First Plugin tutorial and am using the code that opens Inventor to start the form. I have both Inventor 2012 and 2013 installed on my system. I have gone in to the properties and changed the .dll reference file to read out of the bin/PublicAssemblies folder in 2013, however, when I run my Windows Form, it will open Inventor 2012 instead.
I have a couple of VB pieces of code that set up the standards of my company. What I want to do create a button in my Workspace -within a tab created by me with the CUI tools- and trigger my VB code.
I am having trouble finding a reference for how to use field code. I am trying to create a custom fied in MTEXT that will only display the 1st 25 characters of a filename. I can't find any good resources to explain how field code in AutoCAD works on the web.
I am new to .Net and trying to do some C# programming. Where can I find some Autocad sample code for download?. Also where can I get the following namespaces?.
Because there is no way to tell the difference between minimize ("-") to close ("x") on palette set. I put a button on my user control to write my own code to close the Palette Set.
m_ps is the current PaletteSet, m_uc is my user control which has been loaded into m_ps.
what code I need to write inside my close button click event to unload m_uc , close m_ps and set both m_uc and m_ps to nothing?
How do I specify the code set to be used on subassemblies when creating an intersection? I want to specify this in a command setting so that the intersection is built correctly without me having to edit feature lines in the corridor properties for th intersection.
Is it possible to code a custom linetype, so that it only follow certain annotation scales (e.g. 1:100, 1:200 1:500) and so that it just appears as a continuous line below and above these certain scales?
The solution should work even when the drawing is used by others and apply to both modelpsace and paperspace (viewport).
I want to open a dwg file from code in my program. I have a string variable containing the full path and file name. I want to open the dwg file in an instance of Autocad that is already running, I don't want to open Autocad. The program is written in VB 6.0.
My sections are showing a label for some of my links that are coded as "top". My label style for the "top" link is set to none and some of the labels are still displayed.
The labels show in the sections, but not the assembly. We are running Civil 3D 2012.
I am moving from VBA to VS2010/12 and I am having my first problem
Firstly, I read that I should install AutoCad 2013 DoNet Wizard to be able to compile and debug my code. After install it I managed to "debug" when I set the brakepoint but I couldn't change the code while debugging...
I did a fast search in this forum and I found some similar issues but they where old posts (before C3D2012 and VS2012). So, is it possible now to edit code while debugging as I was able to do in VBA? This will save me a lot of time. Mostly in my case once I'll make a lot of beginner mistakes...
In some post I found that we should install a virtual machine and run in 32bits mode to be able to edit. This is the best solution?
The company I work for uses Illinois DOT linework Codes.They had been using Microstation. But the office Im in uses Civil 13. Any linework code set that I need to process field to finish?
I included a VB code in our drawing template, but then I get the "Warning: You have a non-empty VBA project.." message. If I copy the code into iLogic, I just get an error message. Why it runs fine as a separate macro, but doesn´t work in Inventor, or how I can include the code into the template? URL....
I implemented the code from the autodesk developers guide for plotting. [URL] .... I made a few minor changes such as making it a sub instead of a command, and commented out a few of the plot settings
the routine seems to work except that I don't get a PDF
I added the actrans.commit() to see fi that might work = nope.
also note that ACF.acdoc & ACF.db in my code replace acdoc & acCurDb in the original code
'<CommandMethod("PlotCurrentLayout")> _ Public Sub PlotMe(suBpath As String, subFileName As String) '' Get the current document and database, and start a transaction 'Dim acDoc As Document = Application.DocumentManager.MdiActiveDocument 'Dim acCurDb As Database = acDoc.Database Using acTrans As Transaction = ACF.Db.TransactionManager.StartTransaction() [Code] .......
I am using below code to create a Rectangle 4 mm X 3 mm x 1 mm, I am using mm template but the model shows 40 mm X 30 mm x 10 mm.
Private Sub CommandButton1_Click() Dim oProjectMgr As DesignProjectManager Set oProjectMgr = ThisApplication.DesignProjectManager Dim oTemplatesPath As String
I make a code set style by doubling the "all codes" style. Then make styles of links points and shapes in which i turn off the visibility in model. I also leave the render materials in links.
I try the set with 3d orbit. But as i turn around the model the rendering materials start to uglify..I attach an image to better understand what i am saying.
When i turn on the visibility of links the problem solved.
I am looking for a .Net code that can read each row cell and draw the polygons automatically in AutoCAD window. I am having a bout 100 rows (polygons) and hence I prefer that the code will display all polygons at once in AutoCAD window and not draw them one by one.
I am already having Autolisp code to draw them one by one but I wish to have a .Net code to allow batch polygons drawing instead.