bpatrick Posted March 2, 2009 Posted March 2, 2009 I am trying to develop a vba subroutine to help me insert blocks of fire alarm speakers. The speakers have to be spaced at various spacing. What I would like to do is manually insert a speaker and have some sort of square around the block while I am inserting it. The "temporary" square would be of dimensions which I assigned it. So if I was trying to insert speakers at 40 foot intervals I would have a 40' x 40' box around my speaker block while I am manually inserting it. You can think of it as sort of a "ruler" or guideline for inserting my block. I don't want the box inserted... just to appear while I am manually inserting a block. I am "ok" with VBA but I just can't figure out how to approach it. Any tips or direction would be helpful. Quote
Lee Mac Posted March 2, 2009 Posted March 2, 2009 Have you tried the "DIVIDE" or "MEASURE" commands to accomplish similar results? Quote
bpatrick Posted March 2, 2009 Author Posted March 2, 2009 Thanks for the quick response Lee. I did look into the Divide and Measure commands after seeing your post. I don't believe that would be the most efficient approach based on my circumstances. Essentially I am quickly "roaming" through hundreds of rooms and just clicking to drop a block where I need it. If I am able to have a square guide as a cursor, showing my allowed spacing then I could quickly run through and drop lots of blocks in different rooms on a floor plan. Let me know if I am misunderstanding anything regarding Divide and Measure but I don't believe they are uniquely suited for this case. Quote
David Bethel Posted March 2, 2009 Posted March 2, 2009 I would have thought that you would be looking more towards a circle in lieu of a box. maybe (grvecs) would help. [b][color=BLACK]([/color][/b]initget 1[b][color=BLACK])[/color][/b] [b][color=BLACK]([/color][/b]setq c [b][color=FUCHSIA]([/color][/b]getpoint [color=#2f4f4f]"\nCenter Point: "[/color][b][color=FUCHSIA])[/color][/b][b][color=BLACK])[/color][/b] [color=#8b4513]; r=radius[/color] [color=#8b4513]; a=start_angle[/color] [color=#8b4513]; s=segments/2[/color] [color=#8b4513]; i=increase_angle[/color] [color=#8b4513]; pl=point_list[/color] [b][color=BLACK]([/color][/b]setq r 20 a 0 s 16 i [b][color=FUCHSIA]([/color][/b]/ pi s[b][color=FUCHSIA])[/color][/b] pl nil[b][color=BLACK])[/color][/b] [b][color=BLACK]([/color][/b]repeat [b][color=FUCHSIA]([/color][/b]* s 2[b][color=FUCHSIA])[/color][/b] [b][color=FUCHSIA]([/color][/b]setq pl [b][color=NAVY]([/color][/b]cons [b][color=MAROON]([/color][/b]polar c [b][color=GREEN]([/color][/b]+ a i[b][color=GREEN])[/color][/b] r[b][color=MAROON])[/color][/b] pl[b][color=NAVY])[/color][/b] pl [b][color=NAVY]([/color][/b]cons [b][color=MAROON]([/color][/b]polar c a r[b][color=MAROON])[/color][/b] pl[b][color=NAVY])[/color][/b] pl [b][color=NAVY]([/color][/b]cons 1 pl[b][color=NAVY])[/color][/b] a [b][color=NAVY]([/color][/b]+ a i[b][color=NAVY])[/color][/b][b][color=FUCHSIA])[/color][/b][b][color=BLACK])[/color][/b] [b][color=BLACK]([/color][/b]grvecs pl[b][color=BLACK])[/color][/b] -David Quote
Lee Mac Posted March 2, 2009 Posted March 2, 2009 I wish I knew more about the grvecs function - that and the grread and grdraw are always a mystery to me. And the ACAD help on grvecs isn't too helpful either.. Quote
David Bethel Posted March 2, 2009 Posted March 2, 2009 Lee, GRVECS and GRDRAW are pretty simple. Different input style, same basic output ( temporary lines displayed on the screen ) GRREAD is a totally different animal and has always had a bad rep as far as consistancy. I've never used the translation mode matrix with grvecs. -David Quote
Lee Mac Posted March 2, 2009 Posted March 2, 2009 Oh I see, so you are effectively creating the list in reverse, hence the last (cons 1 pl) sets the colour. And a suppose you are creating a list of points around the circle between which lines will be drawn. Thanks David, I understand it a little better now Cheers Lee Quote
bpatrick Posted March 2, 2009 Author Posted March 2, 2009 Thanks again guys. I will look into GRVECS (which I am not familiar with). If there are any recommendations using VBA I would greatly appreciate them. Quote
Lee Mac Posted March 3, 2009 Posted March 3, 2009 I believe this uses grvecs or something similar - you may find it useful to learn from: The Genius that is ASMI Quote
bpatrick Posted March 3, 2009 Author Posted March 3, 2009 Yep, that looks very similar to what I'm trying to do (just a different application). Looks like I need to learn some LISP. I was hoping for VBA since I'm familiar with that... but I will take what I can get since I can't find anything else. This forum is very helpful... thanks for the tips and pointing me in the right direction! Quote
Lee Mac Posted March 3, 2009 Posted March 3, 2009 No problem, happy to help If you have any more questions, just feel free to ask. Lee 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.