Program that creates a bunch of block references
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
So for work I have created a program that creates piping drawings from many different existing blocks of pipes, flanges, and fittings.
The user runs the AutoDraw macro to start the drawing creation process. Then the user goes through a series of about 10 userforms populated with radio buttons and combo boxes to specify each exact part. After each userform is filled out and the "Done" command button is pushed, the program creates the associated block references and the next userform pops up.
My problem is that the program doesn't actually draw the block reference after pressing the done button even though the code does. Instead, the user has to go through all 10 userforms and spec everything out with nothing physically getting drawn in modelspace until the last done button is pressed. After the last form is done, the whole drawing gets created instantly.
I want the program to show each additional part on the DWG as each UF is completed, so if they picked the wrong part they will see it and can go back to fix it instead of having to run through the whole program again.
I am not really a good coder (mechanical engineer), so I probably didn't organize the program in a clean way. Here is the jist:
Module 1:
-Define a bunch of global variables related to each specific part and part location
-Master subroutine that calls all the sub-functions
*Call Draw 1
*Call Draw 2
*Etc
End Sub
-Then Draw1 function shows the Draw1 UF, the user selects identifying info, and the done button closes the UF
-Draw1 continues to take the info and select the proper block and places it where it needs to go....End Function
-Then Draw2 ........
And that is the module, and the whole program.
I've tried a lot of things to get the block references to draw and nothing has worked. Made a Do loop timer to give Autocad time to put down the block references before the next UF is called. Tried to split each function into a different module. Tried to put the set block code into the done button of the UF and that didnt work.
Please help!