guitarguy1685 Posted November 21, 2009 Posted November 21, 2009 Hello guys. Well I've been using simple lisp's for years and have just started getting more complex. I have a bit to learn but with this resource along with books I've bought im learning a ton. For this next project I think I need to learn VBA. I want to create a dialog box in autocad that will allow me to search for a certain block. What I envision are a set of drop down menus that will guide me to the appropriate block. For example. I might select Fasteners, then type of fastener (screw or bolt), diameter then finally length. sooo 1st box (Fastener) | 2nd box (bolt) | 3rd box (..625) | 4th box (3") I hit ok and then I insert the block. Is this possible in VBA? And does anyone know some online resources to get started with vba and/or some good books? Quote
flowerrobot Posted November 21, 2009 Posted November 21, 2009 Yes it can be done it vba, however Should be done in Vba.net if you follow that path. From what i understand you want, It can be done in DCL. However i would recommend using ODCL. It is very simple to use, and gives you directly what you need, However it dose need an addon to work, So when passing the code around need to pass the .exe with it Quote
guitarguy1685 Posted November 22, 2009 Author Posted November 22, 2009 awesome. i dl'd ODCL and just getting my dialog box organized. It doesn't have any functionality yet. What addon do I need to get it to work? Quote
flowerrobot Posted November 22, 2009 Posted November 22, 2009 The thing you downloaded i assume is the design tool so that has every thing packaged, The addon i was refering to was the .arx files. There should be some post on there site if come to distrabuting the codes Quote
JohnM Posted November 22, 2009 Posted November 22, 2009 The runtime files are installed when you installed the openDCL studio. The runtime arx files for open dcl are located at c:\program files\common files\opendcl You will need the arx files and the enu folder if you are using English. Quote
fixo Posted November 22, 2009 Posted November 22, 2009 Hello guys. Well I've been using simple lisp's for years and have just started getting more complex. I have a bit to learn but with this resource along with books I've bought im learning a ton. For this next project I think I need to learn VBA. I want to create a dialog box in autocad that will allow me to search for a certain block. What I envision are a set of drop down menus that will guide me to the appropriate block. For example. I might select Fasteners, then type of fastener (screw or bolt), diameter then finally length. sooo 1st box (Fastener) | 2nd box (bolt) | 3rd box (..625) | 4th box (3") I hit ok and then I insert the block. Is this possible in VBA? And does anyone know some online resources to get started with vba and/or some good books? DCL will be an easiest way for this programm IMO See attached ~'J'~ fasteners.LSP Quote
BIGAL Posted November 23, 2009 Posted November 23, 2009 If your blocks are are already made then you can get lisp or VBA to add the parts that make up a name of a block. You would use say a menu system to pick easier than writing dialouge boxes. Say block is BOLT6253 this would be made up of bolt + 625 + 3. One thing that has dropped off in autocad is the use of "screen menus" these can hold variables and return a value to say a lisp program. As an example we had an automated brick routine for widths rather than remember a width a menu would pop up on the side and you just pick the value the good thing is stuff like 3" can be used in multiple programs **BO 3 BRICK ROD OPENING LENGTHS [0 - 2390]$S=BO1 [TO 4670]$S=BO2 [TO 6950]$S=BO3 [TO 9230]$S=BO4 [TO 11510]$S=BO5 [TO 12110]$S=BO6 **BO1 250 370 490 610 730 850 970 1090 1210 1330 The numbers are returned same as if you type them in. We dont have a need to select values all the time now hence dont use this method but it works well and is easy to write as its in a menu compared to a hard coded dialouge list (setq brick_wid '("0.5 110" "1.0 230" "1.5 360" "2.0 470" "2.5 590" "3.0 710" "3.5 830" "4.0 950" "4.5 1070" "5.0 1190" "5.5 1310" "6.0 1430")) and then check whats picked (start_dialog) (cond ((= newans 1)(setq brno 110)) ((= newans 2)(setq brno 230)) ((= newans 3)(setq brno 360)) ((= newans 4)(setq brno 470)) ((= newans 5)(setq brno 590)) Quote
guitarguy1685 Posted November 24, 2009 Author Posted November 24, 2009 I can use menus but I need a dialog box for a dwg preview. Also can anyone recommend a book to learn DCL for autocad? Quote
JohnM Posted November 24, 2009 Posted November 24, 2009 why not use openDCL? it's more flexable and has a blockview tool. and thier forum is great for help Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.