Message 1 of 7
need macro code

Not applicable
07-15-2008
10:47 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi, Since Autocad has not seen fit to add a macro recorder to their program, I was wondering if anyone could give me a little help writing one. I'm using Autocad 2007.
What I have is a grid of blocks (269 of them) on one layer. Each block is 10m by 10m by 12m deep. Each block is identical except for a unique integer in the attribute 'NO'. On other layers are other objects (sample location blocks, underground pipes and foundations, etc.) left on the site.
Once I have the proper layers turned on and everything else off, what I would like when running the macro is to have a dialog box come up with the following:
Initially, a label at the top with instructions ("Select grids to move then hit Enter.") Beside this a command button to send the user to the drawing. Here the user will select all the grid blocks to perform a 3D Move (by displacement) on, then will hit Enter. If none are selected before Enter then exit sub.
Once done and the user hits Enter, the dialog box re-appears.
Below the label a text box displaying all the grid blocks selected.
Next the user is asked to select the color to change the selected grid blocks. A command button to bring up the Select Color box.
Next will be a label asking for the distance to move the grid blocks and an input textbox to type in the number.
Finally at the bottom an OK and Cancel buttons. The OK button will then transfer control back to the code to perform the tasks. Oh, any of the objects on the other layers that fall within the selected grid blocks should also be moved (but not re-colored) when the grid blocks are moved.
I am a little familiar with VB code but not in relation to Autocad. And Lisp looks like total Greek to me.
Thanks.
What I have is a grid of blocks (269 of them) on one layer. Each block is 10m by 10m by 12m deep. Each block is identical except for a unique integer in the attribute 'NO'. On other layers are other objects (sample location blocks, underground pipes and foundations, etc.) left on the site.
Once I have the proper layers turned on and everything else off, what I would like when running the macro is to have a dialog box come up with the following:
Initially, a label at the top with instructions ("Select grids to move then hit Enter.") Beside this a command button to send the user to the drawing. Here the user will select all the grid blocks to perform a 3D Move (by displacement) on, then will hit Enter. If none are selected before Enter then exit sub.
Once done and the user hits Enter, the dialog box re-appears.
Below the label a text box displaying all the grid blocks selected.
Next the user is asked to select the color to change the selected grid blocks. A command button to bring up the Select Color box.
Next will be a label asking for the distance to move the grid blocks and an input textbox to type in the number.
Finally at the bottom an OK and Cancel buttons. The OK button will then transfer control back to the code to perform the tasks. Oh, any of the objects on the other layers that fall within the selected grid blocks should also be moved (but not re-colored) when the grid blocks are moved.
I am a little familiar with VB code but not in relation to Autocad. And Lisp looks like total Greek to me.
Thanks.