Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  HOME    TRACKER    Visual Basic




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Running AutoCAD In My IIS Application

i have an iis application i made in vb that takes user input, draws a custom drawing in autocad, and displays it back to the user with VRML.

i can get this to work in vb's debugging mode (when vb and my code are open), but when i try to use the packaging and deployment wizard, the stand alone version doesn't work!

when i click to submit my data, autocad doesn't seem to draw anything and it creates an empty VRML file. i can see from the task manager that autocad runs, but it doesn't grow in size (amount of memory it takes up) like it did when it worked correctly.

did i do the package & deployment wizard wrong? could there be some setting on my server i need to change? And yes, i do have Posting Acceptor 2.0 installed.

thanks for your help!!!!


Trying To Make An Application For Autocad Using Vb6
to keep my question simple as possible, this is what i am trying to learn how to do.

make a "stand alone" application using visual basics 6 that will allow the user to input information, and will then generate a file (like a dxf) file that can be opened in autocad.

for example,
1. user opens the stand alone vb application.
2. application asks for length of box, user inputs 5 inches. (or whatever)
3. application asks for width of box, user inputs 10 inches. (or whatever)
4. user then its (command) button labeled (draw it now!!)
5. application creates dxf file called box.
6. user opened autocad, and openes dxf file called box, and he now has an autocad drawing of a box that is 5 inches by 10 inches!!!

that is very small scale example of what i am trying to learn to do, but if i could figure out just how to do this basic thing, even if it is to get autocad to draw a line, i would be doing good.

is there an exmple download, a web site, tutorial, a book, anything that anyone knows of that can help me learn this that i am trying to do?? any help is appreciated.

AutoCAD With VB(A) Without Opening AutoCAD
Hi everybody.

Do you know a way to use AutoCAD with vb or vba without opening AutoCAD. I would like to draw files or to use AutoCAD possibilities without opening AutoCAD. Is there an .OCX or something like that ? Any other idea ?

How To Use Autocad, Without Installing Autocad
i program vb6 sp5 applications that use the autocad drawing engine, this works fine for most all applications as autocad is installed on the target machine, but now have run into a problem where the target machine won't have autocad installed. how do you create an instance of autocad without having autocad installed on the target machine???


vegetarian is indian word for lousy hunter.....

AutoCAD VBA...please Help
I want to write a macro or a LISP routine that will draw points for me. I have dxf files and I want to start at the end of the polyline, draw a point there, and then draw a point at every nearest endpoint there after until I hit the end of the polyline.

In the long run I would also like to open a number of dxf files that are saved in the same folder, and complete the macro for each of them. I would like a pop-up window where I would specify the folder, then another that I would specify the bottle number (these are dxf's of bottle geometries), and it would know what files to open. Thanks in advance.

AutoCad AND VB
Ok I have asked this question and I have not been clear. I also left out some important info.

I am trying to get VB to open up AUTOCAD LT and paste some data in a specific Drawing.

AUTOCAD LT does not have a VB editor like some have thought.

I am completely stuck.

Thank you


AutoCAd And VB
I want to write a script so I can open AutoCad and paste something into a Autocad Drawing.

How do you active a program that isn't Vb or a Vb application?

Thank you


Autocad And Vb
Hi all
I'm just trying to open a file in autocad .. I just can't see the file update in acad .. or autocad don't open the drawing
can you tell me why or how can i open the drawing if there's a better way.
On Error Resume Next
Set acadApp = GetObject(, "AutoCAD.Application")
If Err Then
Set acadApp = CreateObject("AutoCAD.Application")
If Err Then
MsgBox Err.Description
Exit Sub
End If
End If
MsgBox "Now running " & acadApp.Name & " version " & acadApp.Version

Set acadDocs = acadApp.Documents
Set acadDoc = acadDocs.Add("c:lah.dwg")

AutoCad && VBA?
Anyone has experience with AutoCad & VBA? I have some issues with Xrefs. Let me know. Thanks

AutoCAD And VB

I want to manipulate drawings in AutoCAD r2000. I can't find dir boxes or filelist boxes in VBA for AutoCAD.

Does anyone have the syntax to do the following in VB6;

Open a drawing
Close a drawing
Insert a block.

I can get AutoCAD started but having problems from there.

How can I make program in AutoCAD VBA to calculate demission of all line in current layer?

How do i draw a center line in AutoCad using microsoft visual basic ?


anyone know autocad here?

plz if anyone know
then if he can help me to read a table from autocad
or how can i read anything from a saved autocad file
and thankx alot for helping

Sorry to hog this forum with two questions on one day, but does anyone know if I can find specific elements within an AutoCAD DXF file using VB or VBA?

I was thinking of changing AutoCAD drawings by accessing the DXF file, searching for the handle and changing some values.

Any better ways?

P.S. can't find an AutoCAD forum so posted it here....

Has anyone heard of a control for autocad? This is for VB of course

VBA With Autocad
i need information about vba so that my vb application can communicate with autocad application.

Firstly what references do I want to use to open AutoCAD as an object? (AutoCAD 2000 LT)

Secondly, what code do I use also?

I am trying to create automated drawing with a few blocks, but am unable even to open the application from code.

rather frustrating.

If anybody could help me out here, I would be very greatful.

Autocad && Jpg
Is it possible to save (convert) autocad drawings to jpg files ???

Thanks , Moyalt.

VB AutoCad

I'd like to collect data from AutoCad drawings by using Visual Basic.

What I want is to work out the data from AutoCAD while the drawing(s) itself
must be invisible.

But the following code doesn't work properly: AutoCAD drawings are still

Here is a fragment of my code

Can anyone show me the fout in my code?

Help! Please!

On Error Resume Next

Set acApp = GetObject(, "Autocad.Application")

If Err.Number <> 0 Then


Set acApp = CreateObject("AutoCad.Application")

End If

If acApp Is Nothing Then

frmDialogBox.NewDataOK = False

MsgBox "The applicatiion 'DialogBox' couldn't start up AutoCAD on
this work station." & vbCrLf & _

"Please contact the ICT HelpDesk (9100) OR try it again.",
vbCritical, frmDialogBox.strTitle & _

", Function CadDataFromFile"

frmDialogBox.CadDoorgaan = False

Exit Function

End If


acApp.Visible = False

On Error GoTo Err_Control

Set acDrawing = acApp.ActiveDocument.Open(FullFileName)


Thanks in advance

AutoCad VB
What is an easy way to which your dimstyle. The thing I am trying to do is auto dimenion a part after the user fills out some infomration.


VBA Autocad Help
Hi everyone,
I have recently started to delve into VBA along with Autocad  He is my beginner code that should count blocks in an autocad drawing. However, only the block names are placed in ListBox1 and a 0 count for all of them in ListBox2.
Can anyone see a reason?

Sub CommandButton1_Click()
    Dim i, j, btot As Integer
    Dim bnam As String
    Dim ent As Object
    btot = ThisDrawing.Blocks.Count
  For i = 0 To btot - 1
    bnam = ThisDrawing.Blocks.Item(i).Name
    If Not Mid$(bnam, 1, 1) = "*" Then ListBox1.AddItem bnam
    Next i
   For i = 0 To ListBox1.ListCount - 1
    bnam = ListBox1.List(i): btot = 0
    For j = 0 To ThisDrawing.ModelSpace.Count - 1
    Set ent = ThisDrawing.ModelSpace.Item(j)
    If ent.EntityType = acBlockReference And ent.Name = banam Then btot = btot + 1
        Next j
        ListBox2.AddItem btot
    Next i
End Sub

Autocad Help
wasted too much time looking for and reading documentation. can someone please help or point me in the right direction? i'm trying to write a simple vb application that will open an autocad drawing and read a spec/dimension off the drawing, but i can't figure it out. thank you in advance.

AutoCad Lin
Hello All Members
can i make a link between the data of the msflexgrid to Autocad to draw it!!
Thanks alot for advice

Egyptian Man

how can i take a drawing from autocad to my VB Application

Autocad +vb

I want to open a drawing file from a commandbutton click in visual basic.. how to do this..

any source???


VBA Autocad

I have a developed an appln with ado control, in autocad vba. But i m not sure that the user may contian the ado control.. If not available, what I have to do.. Or how to create setup......

any solution.....


how can i make a link that take the output numbers from my visual basic application to autocad program to draw these data and then make OlE to the drawing data from the autocad to VB application again.i hope u can understand my question!!!!!
thanks for advice

Egyptian Man

AutoCAD Using VBA
I am using customization of AutoCAD using VBA IDE. I want to display a list box for the user to enter text information in it when I click on a specific region on the this drawing model space , then store this text information in the database. The facility to enter the text information should be region specific, for eg if I have a circle and a rectangle on the drawing space , I would want to enter different text information when I click on the drawings separately . That is to say that, i would want to store more data in case of a rectangle then in case of a circle. So I might have different tables to store informations relating to the rectangle and circle. So when I click on the circle, i need a list box where I could enter text information for the circle and store it in the database table for the circle, and likewise for the rectangle.

AutoCad Anyone
Any one out there a VBA for ACAD guru. I am trying to use the command prompt to display informatio from The vba app I am running. I can get the data to the command line prompt, but I cannot get the command line to scroll up when I add the new (I want next Line) data.

It just keeps overwriting the existing line.

I already tried adding "& chr(13)" to the prompt line.

If anyone know a good VBA for ACAD site I would settle for that.


VBA And Autocad Menus
Hi there,
I appologize to all If my thread is in the wrong section.
I'm wondering if there is a way to control menus build in any application running under windows through the use of VBA?

AutoCAD Blocks
Maybe I'm losing my mind but I can't remember how to simply insert a block into an autocad dwg using vba.
A push in the right direction would be greatly appreciated.

Using AUTOCAD LT 98 FromVB
Hi All,

I'm trying to run an AutoCAD LT98 application from VB, but all I can do is start it up! using the following:

Private Declare Function SendMessage Lib "user32" _
Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, _
ByVal wParam As Long, ByVal lParam As Long) As Long
Private appval

Private Sub StartCommandPrompt()
Dim r As Long, hWindow&
appval = Shell("C:program filesautocad 2000iacad.exe", vbNormalFocus)
End Sub

I've previous had Auotcad 2000 running from VB by referencing it in VB but cannot reference the AutoCAD LT98 DLL's.

I was think that possibly there was a way of sending messages to the AutoCAD LT98 command line? Any suggestions?



AutoCAD Preview
Hello programmers,

Question : Does anybody knows how to show the preview of an AutoCAD drawing with VBA ?


Autocad VBA && Xrefs
Company uses Autodesk Architectural. I am attempting to write a macro that will update xrefs in a set of drawings after they've been moved (we will be doing massive server/drive reorganization, automating this process would save a ton'o'time). Am VBA person, not Autocad person (opposite of everyone else here), have algorithm for process but unable to figure out xref commands without help files. Found some xref items in object browser but they appear to all be booleans and read onlys, nothing that lets me actually read/change the actual xref pathname. is there an object/property for this in VBA and if so how do I access it?

Thanks anyone who can help!

Autocad, VB, And Excel

I am new to hardcore Visual Basic Programming. Normally I'm a hardware person. Anyway, I am designing a fullsize aircraft and have Autocad 2000, MS Office 2000, and Visual Basic 6 Learning Edition, and AutoCad 2002 (15-day license) to help me make it happen.

I have encountered problems and the answers lie in using the powerful tools of the combined programs above.

1. The first problem is my that airfoil data is in Excel cells. As you can imagine with a main wing of various diminsions, and tail feathers of various lengths and airfoil selections, it is not an easy job trying to calculate all of the plots for each station and then enter them into an AutoCad 3D plot. I'll be an old man, too old to fly by the time I get all of the data entered.

2. Since my aircraft is still in the design stages, I still have to make the final weight and balance calculations, load bearing structure adjustments, etc. So if I have to move something, Murphy's Law states my problem grows exponentially.

3. Since the main wing has an 8 Degree Dihedral, I need to show the ribs leaning at, well 8 degrees.

4. The fuselage diminsions fall into the same problem with #1.

I saw a thread from a user requesting assistance for Visual Basic, Excel and Autocad and tried to run the program. I guess I wasn't holding my head the proper way since it didn't work.

I even stood on my head and made burnt offering to the computer Gods and it still wouldn't work. So I guess I'm still a Beginner/Novice.

So I am in need of a little hand holding and friendly help.

Thanks in advance for your time.



Oh yes, I can fly and build airplanes a lot better than I can program.

Autocad And Access
I'm trying to make a database of drawings that were created in Autocad. I have a form setup with a browse button that can be used to navigate to the location of the drawing that is to be added to the database. I then have a button to open autocad, and retrieve the data that I need from autocad. The problem is, I want to return this data back to the form so that the user can edit it, I don't want to just pop it into a Table. Is there any way to reference the currently open form and it's objects?

VBA, AutoCad To Excel

I am trying to write some data from MSFlexGrid in AutoCad to Excel file.

I have CommonDialog with name "AskToSave" in Form1, and set filter: Excel files (*.xls)|*.xls|All Files (*.*)|*.*

When I press some button program should ask me for the path and file name for excel file I want to create and save. I don't need to open the Excel or write something to it at the moment.
Excel file with chosen name and selected path should be just created.

Next step will be to open that file, write some date in it and just save it with the same name. I don't need help with this part.

Please help to solve the Problem:

Private sub SomeButton_Click()

Dim NameOfFile As String
NameOfFile = AskToSave.FileName
If NameOfFile = "" Then
mess = MsgBox("You must enter file name.", vbOKOnly, "Error")
Exit Sub
End If

End Sub

AutoCAD Blocks With VB6 - Help!!!
I am looking to make a Title Block editor in VB6 (not VBA). I am using AutoCAD Mechanical 2004DX. My dwg files all have a block called "TBLK-D". This block has a various number of attributes associated with it that I wish to edit one at a time.

I am able to open a single drawing. The problem I am having is extracting the information from my autocad block.

Public AcadApp As AutoCAD.AcadApplication

Private Sub Form_Load()
'Open autocad with specified file.
Dim CurDoc As AcadDocument
Set AcadApp = GetObject(, "AutoCAD.Application")
Set AcadApp = New AutoCAD.AcadApplication
If AcadApp.Visible = False Then AcadApp.Visible = True
Set CurDoc = AcadApp.Documents.Open("C:0_Working999999_01_A")

'Get attributes of a specified block.
Dim OldBlock As AcadBlockReference
Dim AttArray As Variant

Set OldBlock = CurDoc.Blocks.Item("TBLK-D")

End Sub
Everything works wonderful until I get to that last line of code (before End Sub). When I run the program, I get a type mismatch. If I define OldBlock as an AcadBlock, the code works fine. The problem then becomes how can I extract the attributes from my title block without the GetAttributes method? Furthermore, when I open the drawing and look at the properties for TBLK-D in autocad, it is called a Block Reference. So why do I get a type mismatch?

Interface Autocad With VB6
Hi guys,
Is it possible to pass the parameter to Autocad thru VB6 and generate drawing. Or
already developed design in Autocad and is it possible to modify thru VB6.
If you have any information abt it. Plz suggest me.
kishor Mungelwar

Is AutoCAD Running??
I need to find out if AutoCAD is open before iI execute my code, and then the code will open it, if it was not and close it when finished. OR NOT close it if it was already open. I have been trying to get this from the help files but so far this is all I've come up with is
{Set ObjYourAcad = GetObject(, "Autocad.Application")
If Err.Number <> 0 Then AcadWasNotRunning = True
and it doesn't work.
Can some one poiint me in the right direction?
Please keep it simple as I do not write programming 24/7.
Or even 8/5
THANKS guys.

Dave. K

Open AutoCAD From VB
I'm having trouble opening AutoCAD from Visual Basic.

Dim acadApp As AcadApplication
Dim acadDoc As AcadDocument

On Error Resume Next
Set acadApp = GetObject(, "AutoCAD.Application")
If Err Then
Set acadApp = CreateObject("AutoCAD.Application")
If Err Then
MsgBox Err.Description
Exit Sub
End If
End If
MsgBox "Now running " & acadApp.Name & " version " & acadApp.Version

Set acadDoc = acadApp.ActiveDocument
The above code was taken directly out of the AutoCAD ActiveX and VBA Developers guide. It seems it opens AutoCAD in the background but then I receive the following message: This action cannot be completed because the other application is busy.

I've referenced the AutoCAD2000 Type Library in the project.
What am I missing?

Thanks for the help!

Insert Dwg In AutoCAD Using VB
Hallo Friends,

I am new here today...searching a code in internet for following problem.

I have a drawing in AutoCAD2005.

I have written a VisualBasic program finding an Appropriate dwg files in Particular folders coz you people know how our Explorer tree form...clicking clicking and so on till we need our particular inorder to minimize the time program works using command buttons and lists all the dwgs in Listview.

now i choose a dwg file in Listview ( i mean its a small drawing which should be inserted in opened drawing ). and click the Button INSERT.
now task is this dwg file which is been selected in Listview shold be inserted in opened autocad drawing.

Please can anybody help me how to write this code for this Button Insert..

Private sub insert_click()
End Sub

it would be very helpfull for me my friends..

i think i have expressed my task in detail..

Thanks - Singoi

Autocad (dwg) To Excel)
how to export dwg file data like dimesions,text,layernames to excel using vb.6
its urgent

Option Same As Autocad
can i create an option same as autocad in vb-application?

Link With Autocad
My friend working with autocad.he needs some fn,those are not available in autocad.That is he may pass a number of values,we have to do some operation and return the result to auto cad.Is it possible to do those caculation in vb project and return the value back to auto cad.Guide me pls.

Integrating AutoCAD And VB6
I have written part of a program for use with autocad 2000. To complete this program it will have to interface with the autocad application. Unfortunately I have no idea how to do this. I have tried searching this site and on the internet without any success. Does anyone know of any sites that explain in straightforward steps how a pull down menu in a standalone VB6 application can be imported into autocad. Alternatively if anyone would be prepared to share the secret that would be a great help. I don't have the programmers reference book which presumably explains all this.

Thanks in advance

AutoCAD VBA - Layers Off
I've done this before but can't seem to remember. I just want to loop through all the layers in a drawing and turn them all off. If someone can help out I would greatly appreciate it.

Creating Add-ins For Autocad Using VB.6.0.
Hello guys,
How to create add-ins for autocad using VB.6.0

Help For Autocad, Programming In VB 6.0
Hello everyone

I am a member who is working on AutoCad and writing the required code in VB6.0.

i could go thru the developer help in AutoCad which is given for VBA
But i found many commands are not working in VB.

can any one help me to find the help for autocad using VB
some documentation or syntaxes or any thing will help,

i am new to this environment, waiting for help.



Copyright 2005-08, All rights reserved