Basic Code?

Basic Code?

Anonymous
Not applicable
450 Views
5 Replies
Message 1 of 6

Basic Code?

Anonymous
Not applicable
Im a complete beginner when it comes to Vba. Does anyone have a Very Very Simple code that can show me some basics? Maybe some explanations on what's going on in the code also? Any help would be great!! One more thing is there, a "Load Selection" of some sort like in VLIDE. That way I can run each string of code to see what it does?. Thanks for any help!!! Mark
0 Likes
451 Views
5 Replies
Replies (5)
Message 2 of 6

Anonymous
Not applicable
Start the editor, type ADDCIRCLE, and hit F1 to get to example code for adding a circle to a drawing. Just paste this subroutine into the ThisDrawing module. To step through code one line at a time, put your cursor in the subroutine and hit F8 to run each line. You may have to switch back to the ACAD window to get past any dialog boxes, etc. Browse through the help file, as almost all of the objects, methods, and properties have sample code. James
0 Likes
Message 3 of 6

Anonymous
Not applicable
In the "ActiveX and VBA Developer's Guide" there is tons of sample code...and instructions if you don't want to buy a book. To run code, make sure the Debug toolbar is displayed. It has buttons on it that look like standard Start, Pause, Stop icons. Click in the left margin of a line of code in your sub to set a breakpoint. Then click the Run button. Execution will start and break on the line where you set the breakpoint. Then use the button to the right of the Stop button to step through the code execution one line at a time. You can also enter short snippets in the Immediate window. -- ---- Ed ---- "Mark Douglas" wrote in message news:4076b802$1_1@newsprd01... > Im a complete beginner when it comes to Vba. Does anyone have a Very Very > Simple code that can show me some basics? Maybe some explanations on what's > going on in the code also? Any help would be great!! One more thing is > there, a "Load Selection" of some sort like in VLIDE. That way I can run > each string of code to see what it does?. Thanks for any help!!! > > Mark > >
0 Likes
Message 4 of 6

Anonymous
Not applicable
Thanks Guys. Is there a window that says what each line value gives me? Like in Vlide? (getvar "DWGNAME") in other window says "Test.dwg)...This kind of thing? Mark "Ed Jobe" wrote in message news:4076c6d4$1_1@newsprd01... > In the "ActiveX and VBA Developer's Guide" there is tons of sample > code...and instructions if you don't want to buy a book. To run code, make > sure the Debug toolbar is displayed. It has buttons on it that look like > standard Start, Pause, Stop icons. Click in the left margin of a line of > code in your sub to set a breakpoint. Then click the Run button. Execution > will start and break on the line where you set the breakpoint. Then use the > button to the right of the Stop button to step through the code execution > one line at a time. You can also enter short snippets in the Immediate > window. > > -- > ---- > Ed > ---- > "Mark Douglas" wrote in message > news:4076b802$1_1@newsprd01... > > Im a complete beginner when it comes to Vba. Does anyone have a Very Very > > Simple code that can show me some basics? Maybe some explanations on > what's > > going on in the code also? Any help would be great!! One more thing is > > there, a "Load Selection" of some sort like in VLIDE. That way I can run > > each string of code to see what it does?. Thanks for any help!!! > > > > Mark > > > > > >
0 Likes
Message 5 of 6

Anonymous
Not applicable
That's the Immediate window. You can use Debug.Print to cause values to show up there. Any variables declared in your sub will show up in the Locals window. Anything more specific, you can set a Watch on and it shows up it the Watch window. All those buttons are also on the Debug toolbar. -- ---- Ed ---- "Mark Douglas" wrote in message news:4076ca46$1_1@newsprd01... > Thanks Guys. Is there a window that says what each line value gives me? Like > in Vlide? (getvar "DWGNAME") in other window says "Test.dwg)...This kind of > thing? > > Mark > > "Ed Jobe" wrote in message > news:4076c6d4$1_1@newsprd01... > > In the "ActiveX and VBA Developer's Guide" there is tons of sample > > code...and instructions if you don't want to buy a book. To run code, make > > sure the Debug toolbar is displayed. It has buttons on it that look like > > standard Start, Pause, Stop icons. Click in the left margin of a line of > > code in your sub to set a breakpoint. Then click the Run button. Execution > > will start and break on the line where you set the breakpoint. Then use > the > > button to the right of the Stop button to step through the code execution > > one line at a time. You can also enter short snippets in the Immediate > > window. > > > > -- > > ---- > > Ed > > ---- > > "Mark Douglas" wrote in message > > news:4076b802$1_1@newsprd01... > > > Im a complete beginner when it comes to Vba. Does anyone have a Very > Very > > > Simple code that can show me some basics? Maybe some explanations on > > what's > > > going on in the code also? Any help would be great!! One more thing is > > > there, a "Load Selection" of some sort like in VLIDE. That way I can > run > > > each string of code to see what it does?. Thanks for any help!!! > > > > > > Mark > > > > > > > > > > > >
0 Likes
Message 6 of 6

Anonymous
Not applicable
If you set a breakpoint like Ed mentioned, then when the code pauses you can simply hold your mouse over an expression and its current value will show up. James
0 Likes