Jump to content
robwell

Dynamic Block help

Recommended Posts

robwell

Thanks for reading and helping.

 

I am trying to create a dynamic block with certain parameters, but having trouble.

 

I would like my Dynamic block to have an object (3/16 diam circle) to insert 6" to the right of entry point.

 

Then has to stretch to the right with a second circle inserting 6" from the opposite end point after stretch reaches a minimum of 18".

 

However, if the stretch distance from insertion point to end point is less than 18", then the circle must be centered.

 

So,

1) Circle must be centered along stretch if

2) Two circles 6" from each end if > 18"

 

I know there are much smarter people out there that can figure this out. It's just slipping my understand how to execute this in the block.

 

I hope this description makes sense.

 

Thanks

Share this post


Link to post
Share on other sites
Incognito Cube

I believe I'm correctly understanding the basic layout of the block you're attempting to create. This looking correct so far? J9osD

Share this post


Link to post
Share on other sites
Incognito Cube

Crap. Do I have to wait for an image link to be approved? :ouch:

Share this post


Link to post
Share on other sites
robwell

I don't know. Maybe so. I'm not seeing an image though.

Share this post


Link to post
Share on other sites
iconeo

You need to use a double lookup table with intervals set to different visibility states as you stretch it in order to toggle from centered to end aligned.

 

Sent from my Pixel 2 XL using Tapatalk

Share this post


Link to post
Share on other sites
SLW210
Crap. Do I have to wait for an image link to be approved? :ouch:

 

All links need approval until you reach 10 posts, but you can attach images directly in CADTutor, no link needed and no waiting for approval, you can attach lots of things directly to CADTutor, just click Go Advanced then Manage Attachments.

 

Your image is not awaiting approval though, I can't see it because third party image hosting sites are blocked at my work.

Share this post


Link to post
Share on other sites
iconeo

Sorta like so.

 

test.dwg

Share this post


Link to post
Share on other sites
robwell

I think I almost have it figured out thanks to your help. I had something already before you posted this example, but it needs tweaking to get it to auto switch visibility states when I pass the 18" mark. I like your example, but I need the base point to be left most and the stretch to the right from there. I like trying to figure these out and build them myself, just need that push with what I am not seeing to do it.

Share this post


Link to post
Share on other sites
iconeo
I like trying to figure these out and build them myself, just need that push with what I am not seeing to do it.

 

Best way to learn IMO

Share this post


Link to post
Share on other sites
robwell

So I am still having trouble figuring out the transfer from one visibility state to another when dragging the stretch past the 18" distance. I would like to use a seamless transition as in your example, but what am I missing.

 

I am attaching my block for reference and pointers.

 

WEEPHOLE.dwg

Share this post


Link to post
Share on other sites
Incognito Cube
All links need approval until you reach 10 posts, but you can attach images directly in CADTutor, no link needed and no waiting for approval, you can attach lots of things directly to CADTutor, just click Go Advanced then Manage Attachments.

 

Your image is not awaiting approval though, I can't see it because third party image hosting sites are blocked at my work.

 

Duly noted, I appreciate the explanation. Makes enough sense for me :thumbsup:

Share this post


Link to post
Share on other sites
iconeo

I'll try and explain. Let me know if any of this is unclear.

  • You need a single Distance parameter. You can attach multiple stretch actions to this in order to properly control the location of your objects. This is what allows you to 'slide' in between the two visibility states. As your distance moves past 18" the lookup table toggles the visibility state according to the rules that you have set. I used two stretch actions for the center aligned setup in order to keep your point object in the right location. Only one stretch action was needed for the end aligned setup.
  • You need a double lookup set, not a single lookup set. To do this right click and copy the Lookup Set and then paste it back in and rename it. Then right click to edit it's properties and click on the add actions button and add another lookup.
  • Then you can assign the Distance parameter to one lookup and the visibility parameter to the other. You tie them together with a random tag (I used 's' and 'l'), that is the same in both lookups.

 

You will want BACTIONBARMODE set to '0' through all this in order to properly work with double lookups.

 

I have finished your block but I thought I'd let you try before posting it.

Share this post


Link to post
Share on other sites
robwell

Thanks. I will work with these notes and comment after I have tried to complete it. I do want to try and figure this out, so thanks for not posting it yet.

Share this post


Link to post
Share on other sites
robwell

I think I got it. Thanks iconeo. My problem was the BACTIONBARMODE was set to 1. I could never see the double lookups. Once I changed that to 0, holy crap there was a literal cloud of lookups from the sets I had previously inserted. Had to delete every one and start over. But it turned out good I think.

 

Thanks for giving me a chance to learn it.

 

See attached.

 

WEEP HOLE.dwg

Share this post


Link to post
Share on other sites
iconeo

Glad to hear it. Mastering double lookups adds a whole new dimension to dynamic blocks.

 

This is very minor but using [0",1'-6") means that at 18" it will toggle to 'end aligned'. [0",1'-6"] and (1'-6",) would better suit your purposes.

 

Thanks.

Share this post


Link to post
Share on other sites
robwell

I agree. I already have many uses in mind to work on. Thank you for all the help and pointers.

 

Minor changes are good. It will get me on the correct path to do it best for how CAD interprets it. I will make those changes.

 

Thank you again.

 

My next task is to tackle a dynamic block similar in fashion, but a lot more complicated. I may be back with questions, but the premise is this...

 

1) distance stretch.

2) hole 3" from each end

3) hole centered between each end hole when distance reaches 24" to 32"

4) at 32" a hole is entered 16" from each end hole

5) then repeat from step 3 from those two newest holes.

 

Hope that makes sense. Any pointers to begin would be appreciated. How many lookups would I be looking at here? I'm thinking visibility states would not be good in this regards.

Share this post


Link to post
Share on other sites
iconeo
I agree. I already have many uses in mind to work on. Thank you for all the help and pointers.

 

Minor changes are good. It will get me on the correct path to do it best for how CAD interprets it. I will make those changes.

 

Thank you again.

 

My next task is to tackle a dynamic block similar in fashion, but a lot more complicated. I may be back with questions, but the premise is this...

 

1) distance stretch.

2) hole 3" from each end

3) hole centered between each end hole when distance reaches 24" to 32"

4) at 32" a hole is entered 16" from each end hole

5) then repeat from step 3 from those two newest holes.

 

Hope that makes sense. Any pointers to begin would be appreciated. How many lookups would I be looking at here? I'm thinking visibility states would not be good in this regards.

 

If I understand you correctly I think you would only need to add one more visibility state. Your lookups will handle all of the toggling of states but simply added more use cases. Just be sure to have a unique identifier for each visibility state that the lookup can tie into.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×