Jump to content

Recommended Posts

Posted

Hello,

could someone help me and make a lisp in which after selecting the group gives alligned dim beetwen group entities?

The best will be also if I can select group and afer select place where the dim line is going. Also if it is not so hard want it to go to sepparated layer called for example "dim_help", which will be in some colour (example)  and not printable. 

 

The group consinst of blocks, blocks are circle with solid hatch; so the lisp shoud catch insertion point or center of circle.

Posted (edited)

You can get at groups and find inside, but for me why would you not go back 1 step and do the donuts and dim at same time much easier. 

 

Is this just a simplified version so objects may not be circles or donuts ? 

 

Its not a hard lisp to write start pt, angle, spacing, how many, all done and yes 1 group. So do 3 @ 16, 8 @ 15, 3 @ 24 etc

 

NOTE word DONUTS have a look at that 1 less object.

Edited by BIGAL
Posted (edited)

I think that "going one step back" is not possible. I'm using rebar add-on. Add-on generate blocks (circle with solid hatch), in given spacing, and also the rebars are grouped. I think that if we go step back something may be going wrong in the add-on. The lisp wil be help for the rebar add-on, which not giving me the result like I prefer, I mean in dimensioning and describing rebars. Add-on wasn't exacly made for bridges, and the "describing" from add-on is too big, to much information, takes too much place. Also it is just different for the what I'm used to :)

 

So like i written above it is not simplifed verison, what I get is group of blocks (circle+solid hatch).

 

The lisp also is help for the second lisp (like You see on second post), I will show me where the spacing change, where the group change, etc - help to catch dimension (fullDIM) in good points

 

I'm maybe not exacly a programmer, but I think that what You wrote is so much easier to do. Lisp that You said will do "circle by circle" with the dimensioning etc. In "my" lisp should somehow find the next object and catch its center. It probably not easy to make the lisp "inteligent" to find which object exacly is next. I think is only posiible if user or lisp will check first which side, X or Y, is longer. 

 

If it all to hard to program I will just  must do it by hand :P

 

Edited by zwonko
Posted

Ok your reading this now as you have posted in second post, by providing the information about how the bars were created has helped a lot, there are a couple of ways explode the group and get circles that is easiest, the thing with lisp is if we do a couple of undo's you get back your "group" but lisp remembers all the circle centres. The second method is to pull the circles out of the group a lot more complicated. 

 

So option one is if all bars have same spacing label as 10x120 c-c  

Second option is different spacing do individually or do we look for patterns 3x120 c-c 8x100 c-c

Posted (edited)

Ok this is your dwg "Dimension divide" so it has blocks not a group that will be next step. So this is very much a start. Result as shown converted 120 dim

 

image.png.0f8da19a37d6ff76e63533af062b7555.png

 

(defun c:1sttest ()
(setq obj (vlax-ename->vla-object (car  (entsel "Pick dimension"))))
(princ "\n\nSelect rebars or group")
(setq ss (ssget (list (cons 0 "INSERT,Group"))))
(if (> (sslength ss) 1)(setq howmany (- (sslength ss) 1)))
(setq dimval (vla-get-measurement obj))
(setq dist (/ dimval howmany))
(setq str (strcat (rtos howmany 2 0) "x" (rtos dist 2 0) "=" (rtos dimval 2 0)))
(vla-put-textoverride obj str)
)

 

Edited by BIGAL
Posted

This is what I was talking about the other dwg the the order of the rebars is 1st, last, then others in order that is why these thing are often not straight forward else would have it done now. maybe tomorrow.

image.png.66eb5f907c0df5a2f7793d99e0965bf0.png

Posted (edited)
3 hours ago, BIGAL said:

Ok this is your dwg "Dimension divide" so it has blocks not a group that will be next step.

Ough, that my fault. Propably I've copied group form other drawing and group disappeard. They should be grouped.

 

3 hours ago, BIGAL said:

This is what I was talking about the other dwg the the order of the rebars is 1st, last, then others in order that is why these thing are often not straight forward else would have it done now. maybe tomorrow.

 

This is why I've thought it will be much easier to be made on two lisps. Let's get it, that group consist of the elements in different spacing

1)   first lisp - first lisp will be help, the lisp is giving me dimensions and show where the pattern (spacing) change. 

2)  do manualy - create dimension in beetwen pattern change (for example in the picture below there will be 120 and 48)

3)  second lisp form the second post (

image.thumb.png.4fa4810a393f8930df4a23ffe4c4899d.png

 

This 1sttest lisp, which You did, is doing the job, but like you said there is the problem that spacing are not the same on group. For me the first thing (makeing dimension with spacing) is much more faster than second thing. First thing is just making spacing dimensions one by one or sometimes even few, if i know where the place of change spacing is. The second thing, make overide on fullDIM is more complicated, must take some calculator (and this is most annoying), calculate fullDIM/spacing, click on full dim, overide its dimtext. 

 

@BIGAL I think that  You read two posts, and want to connect it somehow. And I; I just had my own thing how to do it and planned to do it in two lisps not exacly connected one to another. I've think You want to do it once, not like You written, that sometimes somebody made a code, and after want to change something, which sometimes is so hard to do.  I just thought that connecting that two things in one lisp will be to hard to program, becouse of the spacing change.

I'm really greatfull  to You want to do it right!

Edited by zwonko
Posted (edited)

@Tharwat that's look to what I've ment. For this animation, I see, that there is no option to click where the dimension line is going (I wan't to control where it going, otherwise it can go to other object, near the group).

Edited by zwonko
Posted (edited)

Found something similar on site:
https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-create-aligned-dimension-between-selected-blocks/td-p/5796206

in second post.

Made some changes in code, but I'm not sure if I can post it here. The most trickfull things to do is to get the dimension place (in code is made like in code multiplier for dim distance) and to group result (all dims)

 

EDIT: OK, figured out how to create group. I'm start enjoying making codes. Or not exacly creating, this could be to hard for me...

 

EDIT2: OK, figured also how to select distance from object

Edited by zwonko

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