Jump to content

How to make blocks change over a certain height


Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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..

Link to comment
Share on other sites

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

Link to comment
Share on other sites

 

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...