Jump to content

Recommended Posts

Posted (edited)

Hello,

need a lisp which will help me with rebars dimensioning. So the thing to do with lisp is:

a) I've got dimmension for example it is 120(fulldim).

b) select two points and get distance beetwen them for example 12(dimspac)

c) click on the dimension line and lisp is dividing "fulldim"/"dismspac" and get "multipler". After ddedit dimension text to 10(multipler)x12(dimspac)=120(fulldim).

 

The things to go, is also:

A) drawing is in [mm], dimensions are in [cm], so it will be superb if it can round to 0.5 (dimspac). Dimension scale has factor 0.1

B) "multipler" should be also rounded to 1, above or down, like in expalmple: 10(multipler)x12,5(dimspac)=124(fulldim), or 9(multipler)x12.5(dimspac)=114(fulldim)

C) the masterpiece would be if the "dimspac" will be somehow connected to selected points. I think it could be propably with field and dimension in beetwen entieties, but then, the dimension should goto nonprintable layer

 

Edited by zwonko
Posted

Post an image or dwg so there is no confusion about final answer.

Posted (edited)

Thanks for reply!

Here is attachment DWG.

dimension divide.dwg

 

I think that the most difficult to do is A) and B) from topic post, so it not so necessary.

Edited by zwonko
Posted (edited)

For Admin need to combine the other post as its like this is version "A" other post is Version "B"

 

Beetween group elements dimension lisp - AutoLISP, Visual LISP & DCL - AutoCAD Forums (cadtutor.net)

 

Its easier to look at the two options but again for me I would start by drawing donuts and dimensioning as part of that function. 

 

Rebar with various spacing would have 2 dim rows.

3x120 6 x 100

Tot len 960

 

 

Edited by BIGAL
Posted
6 hours ago, BIGAL said:

For Admin need to combine the other post as its like this is version "A" other post is Version "B"

 

You mean that I should make this post double with version A and B? Let's stand for now that what I've writeen in A) and B) is to hard. Or do You mean that I/admin should connect the topics with two lisp in one?

 

 

Posted (edited)

Its about one type of arrangement of reo bars but a couple of different ways to the answer, depending on the reo bar pattern, often here a post is made a solution is offered and then a second request is made to make a change so a second recoding attempt I am suggesting to avoid that.

 

Combining the two would mean having a multiple option solution up front as you have provided two different dwgs one with equal spacing and another with different spacing is what I understand.

 

I still believe best solution is to go back one step to when the reo bars are created it makes it so much easier to do something. The bars do not have to be in a group and actually its easier if there not, doing a XY sort on the circle centres so they could be at various spacings.

 

Do you create the reo bar pattern ?  There are plenty here that can provide a lisp examples for repeating pattern type stuff like the reo bars. I am suggesting to make life easier.

 

image.png.01c2ffe711287f77c2b629c062d85a05.png

 

 

Edited by BIGAL
Posted (edited)

I've udpated the code which You post on other topic:

(defun c:dimSPAC ()
(setq objspac (vlax-ename->vla-object (car  (entsel "Pick SPACING dimension"))))
(setq dimvalspac (vla-get-measurement objspac))
(setq objfull (vlax-ename->vla-object (car  (entsel "Pick FULL dimension"))))
(setq dimvalfull (vla-get-measurement objfull))
(setq howmany (/ dimvalfull dimvalspac))
(setq str (strcat (rtos howmany 2 0) "x" (rtos dimvalspac 2 1) "=<>"))
(vla-put-textoverride objfull str)
)

For me is enought, I think, for now.

Thanks so much for Your help :)

Edited by zwonko
  • 4 months later...
Posted

Found some time and impreoved the code:

 



(defun c:dimensionselection ()
(setq objspacdim (entsel "\nPick SPACING dimension"))
  	(while (not objspacdim)
   	 (setq objspacdim (entsel "\nPick SPACING dimension"))
  	)
(setq objspac (vlax-ename->vla-object (car  objspacdim)))
(setq dimvalspac (vla-get-measurement objspac))



(setq objfulldim (entsel "\nPick FULL dimension"))
  	(while (not objfulldim)
	(setq objfulldim (entsel "\nPick FULL dimension"))
  	)
(setq objfull (vlax-ename->vla-object (car  objfulldim)))
(setq dimvalfull (vla-get-measurement objfull))



;redefinitions
(setq objfulldimm objfulldim)
(setq objfulll objfull)
(setq dimvalfulll dimvalfull)


)






(defun c:dimSPAC ()
(c:dimensionselection)

(cond
((> dimvalspac dimvalfull)  
(setq objfulldim objspacdim)
(setq objfull objspac)
(setq dimvalfull dimvalspac)
(setq objspacdim objfulldimm)
(setq objspac objfulll)
(setq dimvalspac dimvalfulll)
)
(t (princ "\nOk, lets go"))
)   ;end check of user picked good objspac<objfull


(setq clayr (getvar "clayer"))
 (not (command 	"_.-LAYER" "_M" "7_view_dim_help" "_C" "2" "7_view_dim_help" "_P" "N" "7_view_dim_help" ""))
(command "change" objspacdim "" "P" "LA" "7_view_dim_help" "")  ; change layer


(setq dimvalfull (vla-get-measurement objfull))
(setq howmany (/ dimvalfull dimvalspac))
(setq str (strcat (rtos howmany 2 0) "x" (rtos dimvalspac 2 1) "=<>"))
(vla-put-textoverride objfull str)

(setvar "clayer" clayr)
)

 

 

Change made:

-lisp promt user to select in continous loop - I had a problem that sometimes I've selected nothing.

-lisp change spacing_dim/full_dim if spacing_dim>full_dim- sometimes I clicked in wrong order and dimspac was higher than dimfull. Now lisp controls it if user clicked it wrong

-lisp is moving spacing dimension to other layer which is help, unprintable layer.

 

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