drafting3 Posted May 13, 2013 Posted May 13, 2013 Hi all, I have a dynamic block of some door hinges. Depending on the height of the door, depends on the type & quantity of hinges used. I was wondering if it is possible to have a block that detects height? If I insert the hinge block onto my drawing, and snap the base point of the block to the bottom left of the desired door, stretch the pick point to the top, I would like it to automatically change from 2x small hinges (for doors under 312mm high), to 2x large hinges (for doors under 1000mm), and finally to 3x large hinges (for doors over 1000mm)? I have attached a PDF for visual reference to what I'm talking about. I have no idea on any 'Lisp/VBA/Scripts' in AutoCAD, so any suggestions would be greatly appreciated. Thanks, drafting3. DOORS.pdf Quote
dbroada Posted May 13, 2013 Posted May 13, 2013 Welcome to the forum. Lets start with LISP & VBA. As you are on LT neither of these will work for you. Scripts will but a script is just a list of commands delivered as though they were typed at the keyboard. So if you can't type it at the keyboard it can't (easily) be achieved with a script. I don't know of a way to do what you want automatically although there may be a way. I would probably have 3 different visibility states which I would manually select after stretching the height. The spacing of the hinges could be controlled slightly by the stretch parameter that you use to control the height. Quote
dbroada Posted May 13, 2013 Posted May 13, 2013 Just thinking about the spacing of the hinges, I think you can probably make use of geometrical constraints. I have only briefly looked at them using the Autodesk training example but I think they will work for you. Quote
drafting3 Posted May 20, 2013 Author Posted May 20, 2013 Hi dbroada, Thank you for your reply, I guess I will continue to use the 3 different visibility states for this block, its a shame AutoCAD LT won't do Lisp/VBA because that would have been a great help with a few blocks that I'm working on.. Quote
steven-g Posted May 21, 2013 Posted May 21, 2013 Hi try this, I'll let you do the hard work of adding your hinges (just shout if you get stuck). I wish I could claim credit for figuring it out but that honour goes to http://forums.augi.com/showthread.php?137269-Two-lookups-on-1-parameter vischange.dwg Quote
drafting3 Posted May 22, 2013 Author Posted May 22, 2013 Hi Steven-g, That is exactly what I need! Thank you very much. The link is handy too, I can apply this to a few different things, much appreciated Quote
drafting3 Posted May 22, 2013 Author Posted May 22, 2013 Hi Steven-g, I am having a little trouble understanding how to assign a maximum/minimum dimension to a visibility state (to determine when the different hinges appear/disappear). How was that part done exactly? Quote
steven-g Posted May 22, 2013 Posted May 22, 2013 The trick is having the 2 lookup actions linked to the 1 lookup parameter, Lookup1 (action) uses the distance that you are stretching the block, and enters these as a range of sizes, if you type "Lookup table value reference" into the autodesk help screen, it will explain the different options available for ranges. Each of these ranges assigns a value to the lookup a,b or c in this case, and because the two actions are linked the 2nd lookup is forced to the same value which turns on the correct visibility state for the size you select. It isn't an easy concept, but play about with the numbers, I would also suggest changing the labels a,b,c and the visibility state names to something that you are more comfortable with, purely so that you can try and grasp what is going on. And keep coming back and asking questions. Quote
drafting3 Posted May 23, 2013 Author Posted May 23, 2013 Hi steven-g, Thanks, now I at least understand what I'm doing, but when I finish filling in the second 'Lookup' table, it then comes up with a message saying "The lookup action must be associated with a lookup parameter." I don't understand why this would come up, considering I followed the steps in the above link (assigning 2 actions to the 1 parameter). Do you have any idea whats happening? Am I doing something wrong? Quote
steven-g Posted May 23, 2013 Posted May 23, 2013 Can you upload a copy of the block. I can check it through, did you create the 2 actions in the way described in the link. Quote
drafting3 Posted May 23, 2013 Author Posted May 23, 2013 Yeah I did, see what you can make of it.. I played around with it a bit so instead of being 'Lookup1' & 'Lookup2', it's 'Lookup2' & 'Lookup3'. Hinge.dwg Quote
steven-g Posted May 23, 2013 Posted May 23, 2013 I played around with it a bit so instead of being 'Lookup1' & 'Lookup2', it's 'Lookup2' & 'Lookup3'. I think you broke it The second action had lost it's association with the lookup parameter, I deleted it and put a new set back in, changed a couple of other things as well, see if you can spot the difference. The lookup value (the righthand side of the lookup table) has to be the same in both lookup actions. Hinge.dwg 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.