Jump to content

Dynamic Block Help


resullins

Recommended Posts

I have a block that needs to be able to do a bunch of things... and I'm trying to be clever here, but it's just not working. It's a fairly simple piece of geometry, basically a couple of rectangles. But it needs to be able to do three things. 

 

1. Size itself in two directions independently. This one's easy. However, it gets in the way later. 

2. Change from a surface mount to a flush mount. A surface mount panel will fit the size of the box, a flush mount will overhang 0.5" on all sides. And yes, I want to do this with a surface/flush option, not just make #1 up there endlessly adjustable, if that makes sense. The easiest way to do this is with a Vis. Parameter, but I have something else I want to do with that, and I can't have two. So I was being clever... and using a linear stretch with only two options, into a lookup table, to "pull" the edges of the rectangle out 0.5" if needed. Aaaannnnnnddddd.... here's where #1 gets kludgy... because playing around with those two parameters independently causes some REALLY funny reactions. It will work for a few modifications, and then gets all screwy. 

3. I need spacing markers. Well, I don't... but the people at my company too stubborn to use SNAP and their eyeballs need them. There are 3 standard spacings for these markings, 1.0625", 1.25", and 1.5". THIS is where I was trying to work it with the visibility states. Turn them off, and have different array parameters visible to array the markings on the panel. 

 

I can't even get through the first two properly. 

 

The previous method for this was to use three SEPARATE blocks, with a metric s-ton of visibility parameters. I'm trying to get around that. As you can see, when you need to have every inch-size available between 4x4 and 20x20, you end up with a LOT of possible combinations. I've attached the old block with the Vis. Parameters, and the one I'm working with now to give you an idea of what I'm dpong. Someone help me before I have a stroke. Please. 

_CG_PANEL_BLANK.dwg Wall Panel 4-8 wide.dwg

Edited by resullins
Link to comment
Share on other sites

I had a quick look and really did not understand, I did a project for windows and they had like 5 visibility states, you just picked inside the hole eg a rectang and as the block was dynamic would size in the X and Y automatically to fit asking which state to use. 

 

Why would you not just have a dynamic block with two visibilty states ? 

 

The cg_panel appears to be multiple blocks again could do with different X & Y scales. Just draw say 1x1 then scale as needed.

Link to comment
Share on other sites

13 hours ago, BIGAL said:

I had a quick look and really did not understand, I did a project for windows and they had like 5 visibility states, you just picked inside the hole eg a rectang and as the block was dynamic would size in the X and Y automatically to fit asking which state to use. 

 

Why would you not just have a dynamic block with two visibilty states ? 

 

The cg_panel appears to be multiple blocks again could do with different X & Y scales. Just draw say 1x1 then scale as needed.

 

So, couple of things.... first, AutoCAD won't let you use multiple visibility states. As soon as you put one in, it cuts off that option for you. I know there are lisps to get around that, but I've ALWAYS found them glitchy. So that's why I was trying to use lookup tables, but I can't figure out how to get the input properties for those lookup tables correct. 

 

Second, I can't scale, as the length and widths need to be independent of one another, which is why I was using stretch... but I'm not sure why you're saying the CG_PANEL is multiple blocks? It's just one. 

Link to comment
Share on other sites

Also, going back to what you said about multiple Vis. Param... I think maybe you're referring to the trick about using lookup tables to emulate that... which I could try, I've never done it. But that would be a LOT of combinations. Six options for each possible size, and a LOT of possible sizes. 

Link to comment
Share on other sites

I am getting a bit lost in 6 options for every size. 

 

This is a look up table variables read from the block its uses my Multi radio buttons lisp so does not matter how many values are in the dynamic block look up max about 20. AS I said the length and width is worked out from a pick point inside a rectang using bpoly. So long as its a closed shape bpoly will work so lines plines are ok.

 

image.png.5a7437f2ceb4d6ba8ff5e35755f229c9.png

 

 I think I understand and you want lookups and 2 visibilty states. I do very little with Dynamic blocks so maybe 1st step is the inside and outside you may just be able to set a distance variable to Zero ie the 0.5 so no need for a visibilty state. d3 = d1+d2

 

Once you have the dynamic block can help you with a front end.

 

 

 

 

 

Edited by BIGAL
Link to comment
Share on other sites

Ah... ok, so each size (there are 28), requires 8 options. Spacings: Off, 1.0625, 1.25, and 1.5, and each of those options needs to show either a surface or flush mount option. So that's a total of 224 vis. states. I tried to do the sizing of the panel with stretch or scale actions instead of vis. states, but since the different spacings have to array differently, it was causing issues. I'll post the block when I'm finished so you can take a look at what I'm doing. I know my explanation is a little wanton without visibility. 

 

Now, I did finally find a tutorial video online about the lookup table trick that actually made sense to me! So that was really helpful! And I'm just going to bite the bullet and do it that way. I'm currently done with about 160 of them... only 64 left to go. 

Link to comment
Share on other sites

I did a look up table in lisp it was the equivalent to a Row Col in excel lookup, it was a length, width, so say 22,33 would be the equivalent to a double nth of a list, it removed the need to talk to excel. The 1st  list was the width and can see the row value was length

 

; (list 0 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62)
(list 
(list 19 N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A 102U 102U 102U 102U 102U 102U 102U 102U 102U 102U 102U 102U 102U 102U 102U 102U 103U 103U 103U 103U 103U 103U 103U 103U)
(list 20 N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A 102U 102U 102U 102U 102U 102U 102U 102U 102U 102U 102U 102U 102U 103U 103U 103U 103U 103U 103U 103U 103U 103U 103U 103U)
(list 21 N/A N/A N/A N/A N/A N/A N/A 112B 112B 112B 112B 112B 112B 112B 112B 112B 112B 112B 112B 112B 112B 112B 112B 112B 112B 112B 112B 112B 112B 112B 112B 103U 103U 103U 103U 103U 103U 103U 103U 103U 103U 103U 103U 103U)
another 60 lines

(setq ans (nth (- col 1)  (nth (- row 1) lst)))

Edited by BIGAL
Link to comment
Share on other sites

@BIGAL, I didn't see your response until I'd started doing my lookups. Is that code you posted a way to get large values into a lookup table? Because entering them manually is proving difficult. When I try to select and change a property, the table jumps back up to the top. Video attached. 

 

And if your code fixes that... I apRecording (4-12-2021 8-20-20 AM).screenrecologize, but I don't understand how to use that. 

Link to comment
Share on other sites

I should also add that when it jumps around, as shown in that video I posted, it does sometimes change entries when I go to get OFF that cell. That is going to make this EXTRAORDINARILY difficult to do with 224 entries to get right. Is this normal? Does anyone else have this problem when working with lookup tables?

Link to comment
Share on other sites

There appears to be  problem with your screen recording? When I download it it is only 1kb and of an unknown filetype

Link to comment
Share on other sites

The example was a look up table from excel that uses a row column look. I exported the sheet out as csv then replaced , with space added a couple of (list and ) and all done.

 

image.thumb.png.5c90c44f4f176322a7477c895cecd520.png

 

 

It use a double nth (nth row (nth col lst))

 

I had 9 sheets 1 for each type.

 

Edited by BIGAL
Link to comment
Share on other sites

21 hours ago, steven-g said:

There appears to be  problem with your screen recording? When I download it it is only 1kb and of an unknown filetype

 

My bad... I uploaded the screen recorder's project file. The actual video is too large for this forum, so here's a link. https://drive.google.com/file/d/1OeUqTOX97M7wIQlzkw5J6W3FD9O_A2J3/view?usp=sharing

 

I did get everything working... so I've uploaded the file. I did toy with the idea of doing the size with linear parameters and mixing that in to my dual lookup tables... but since the little cross things array differently and even have different array base points, that was proving really difficult. So this way is really annoying, but it works. I would like to play and try to figure out a better way so that this god-forsaken thing becomes editable... 

_CG_PANEL_BLANK.dwg

Link to comment
Share on other sites

And... @steven-g I've been doing some digging, and I think part of the problem is the fact that I used constraints on my inputs. I.e. it doesn't behave like that if you don't make those linear parameters into lists. 

 

And, I found a work-around, if you input the LOOKUP on the right first, and use the arrow keys to move down and not the enter key, THEN go back and enter the INPUT PROPERTIES it is much nicer. 

Link to comment
Share on other sites

On 4/12/2021 at 3:51 PM, resullins said:

I should also add that when it jumps around, as shown in that video I posted, it does sometimes change entries when I go to get OFF that cell. That is going to make this EXTRAORDINARILY difficult to do with 224 entries to get right. Is this normal? Does anyone else have this problem when working with lookup tables?

I see what you mean, try using the keyboard arrow keys to move between cells and rather than picking values from the drop-down just type the value you want which is much quicker and then use the arrow key to jump to the next cell.

I use LT so I don't know of any 'programming' methods that may work better.

Link to comment
Share on other sites

I was doing that, with some success, but then the third input parameter gets up into two digits, and since it's a list, to get to, say, 19, you can't enter 19, you have to hit the "1" key to cycle through 1, then 10, then 11, then 12, etc. 

 

So that was fun. 

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
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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.

×
×
  • Create New...