Jump to content

check the multiplying of numbers is equal with the dimension


Recommended Posts

Posted

Test1.dwg
Need help with checking the multiplying of numbers is equal with the dimension

Posted

Not color coded but you can check the math visually:

(defun c:foo (/ o s)
  (if (setq s (ssget ":L" '((0 . "dimension"))))
    (foreach e (vl-remove-if 'listp (mapcar 'cadr (ssnamex s)))
      (setq o (vlax-ename->vla-object e))
      (or (wcmatch (vla-get-textoverride o) "*<>*")
	  (vla-put-textoverride o (strcat (vla-get-textoverride o) "\\P<>"))
      )
    )
  )
  (princ)
)

 

Posted

Hi Ronjonp !!!
to go with your Ideea : just rewrite the dimension with corect number (red number)
14x100=1400
So if we have a dimension 1400 and step x100 => 14x100=1400

image.png

Posted (edited)

Like this?

(defun c:foo (/ o s)
  (if (setq s (ssget ":L" '((0 . "dimension"))))
    (foreach e (vl-remove-if 'listp (mapcar 'cadr (ssnamex s)))
      (setq n (/ (vla-get-measurement (setq o (vlax-ename->vla-object e))) 100.))
      (vla-put-textoverride o (strcat (rtos n 2 0) "x100"))
    )
  )
  (princ)
)

 

Edited by ronjonp
Posted

image.thumb.png.a85e369c724b50891dfd9498798f6698.png

 Hope you understand te ideea 
Thnaks in advance !!!

Posted

Code updated above .. only does x100.

  • Like 1
Posted

yes, work perfectly for x100 step, Is it possible for to be in one lisp incuded all the steps 60, 70, 75, 80, 90, 100, 150, 200

Posted (edited)

This is a slight change to what Ronjonp provided.

 

(defun c:foo (/ o s spc)
  (if (setq s (ssget ":L" '((0 . "dimension"))))
  (progn
  (setq spc (getreal "\nEnter spacing eg 100 "))
    (foreach e (vl-remove-if 'listp (mapcar 'cadr (ssnamex s)))
      (setq n (/ (vla-get-measurement (setq o (vlax-ename->vla-object e))) spc))
      (vla-put-textoverride o (strcat (rtos n 2 0) (strcat "x" (rtos spc 2 0))))
    )
  )
  )
  (princ)
)

 

If you have fixed values could do like this can have more values its a library routine. 3 lines of code to make.

 

image.png.6dd8882d23d198e1f8068d756bca5810.png

 

Edited by BIGAL
  • Like 1
Posted

Thanks BIGAL !!!!!
also thanks ronjonp !!!!  for yours receptivity !!!

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