Author Topic: All circle diameter  (Read 2525 times)

0 Members and 1 Guest are viewing this topic.

civil.eng

  • Newt
  • Posts: 66
All circle diameter
« on: May 10, 2021, 06:31:02 PM »
Hi everyone,
I have a drawing that contains lots of circle and I need a lisp to select all the circles and then the lisp create diameter dimension to all of them, like this :

can someone help me?

Lee Mac

  • Seagull
  • Posts: 12913
  • London, England
Re: All circle diameter
« Reply #1 on: May 10, 2021, 06:46:20 PM »
Quick one:
Code - Auto/Visual Lisp: [Select]
  1. (defun c:cdim ( / a c d e i r s v x )
  2.     (setq a (* pi 1.25) ;; Angle from center
  3.           d 0.25        ;; Multiple of radius from center
  4.     )
  5.     (if (setq s (ssget '((0 . "CIRCLE"))))
  6.         (progn
  7.             (setq v (getvar 'cmdecho))
  8.             (setvar 'cmdecho 0)
  9.             (repeat (setq i (sslength s))
  10.                 (setq i (1- i)
  11.                       e (ssname s i)
  12.                       x (entget e)
  13.                       c (trans (cdr (assoc 10 x)) e 1)
  14.                       r (cdr (assoc 40 x))
  15.                 )
  16.                 (command "_.dimdiameter" (list e (polar c a r)) "_non" (polar c a (* r d)))
  17.             )
  18.             (setvar 'cmdecho v)
  19.         )
  20.     )
  21.     (princ)
  22. )

civil.eng

  • Newt
  • Posts: 66
Re: All circle diameter
« Reply #2 on: May 11, 2021, 02:48:44 AM »
Thank you so much sir,
Can you rewrite it by vla-adddimDiametric ??
Thanks in advanced.
« Last Edit: May 11, 2021, 02:52:02 AM by civil.eng »

BIGAL

  • Swamp Rat
  • Posts: 1409
  • 40 + years of using Autocad
Re: All circle diameter
« Reply #3 on: May 11, 2021, 05:10:54 AM »
Why are you not happy with the free answer ? If you want a VL solution have a go. Just google, Lee has done most of the work for you.
A man who never made a mistake never made anything

Lee Mac

  • Seagull
  • Posts: 12913
  • London, England
Re: All circle diameter
« Reply #4 on: May 11, 2021, 06:04:06 AM »
Can you rewrite it by vla-adddimDiametric ??

Why?

jtoverka

  • Newt
  • Posts: 127
Re: All circle diameter
« Reply #5 on: May 11, 2021, 09:56:43 AM »
The only reason one needs a VL instead of command is to use objectDBX. That aside the work is already done for you.

HOSNEYALAA

  • Newt
  • Posts: 103
Re: All circle diameter
« Reply #6 on: May 11, 2021, 01:21:08 PM »

JohnK

  • Administrator
  • Seagull
  • Posts: 10626
Re: All circle diameter
« Reply #7 on: May 11, 2021, 01:40:35 PM »
  • The OP could want to start learning the VL object model (not saying examples v the documentation is the better route to learn but...) because it sounds like they started to do their research?
  • Try one from yourself?
  • Try the one that doesn't work ( https://www.theswamp.org/index.php?topic=49517.msg546591#msg546591 ) and make it work.
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

d2010

  • Bull Frog
  • Posts: 326
Re: All circle diameter
« Reply #8 on: May 24, 2021, 07:59:40 AM »
SubTitle=I change whiteBackGround to manyGreen.
Q1=How to replace the onlyALL->manyGreen with other Image isInside a23.jpg?
Q2=You need execute (dfn_cmd_canceld) all times? (for; You must be sure, make flow-Control of Commands-Prompt with "dfn_cmd_canceld").
 :embarrassed:
Thank you so much sir,
Can you rewrite it by vla-adddimDiametric ??
Thanks in advanced.
You found full source "pp_tdcirclediameter.lsp"
« Last Edit: May 24, 2021, 08:17:11 AM by d2010 »

ribarm

  • Gator
  • Posts: 3266
  • Marko Ribar, architect
Re: All circle diameter
« Reply #9 on: June 27, 2022, 11:54:07 PM »
@all circle diameter (radiuses) ???
Marko Ribar, d.i.a. (graduated engineer of architecture)

:)

M.R. on Youtube