Recent Posts

Pages: 1 ... 7 8 [9] 10
81
CAD General / Re: Draw two arcs
« Last post by Fabricio28 on April 10, 2024, 10:44:55 AM »
The old school way is to draw a ray from the center of each arc to the arc endpoint then use the intersection as the center of the new arc

Hello friend
How are you?

Thanks for replay

But I have only road 1 and 2 (blue lines). And I'd like to result like a yellow lines.
Any advise?

Fabricio
82
XDRX-API / [XDrX-Function(40)] Supports dynamic click Hatching of gap tolerances
« Last post by xdcad on April 10, 2024, 04:30:28 AM »
Code: [Select]
(defun c:tt (/ box dynpt e1 e2 edge hch minl old-edge patten scale ss)
  (defun *error* (msg)
    (xdrx_pointmonitor)
    (xdrx-entity-delete old-edge edge (xdrx-getpropertyvalue hch "assocobjids") hch)
  )
  (defun _callback (dynpt)
    (defun _equal (e1 e2)
      (equal (xdrx-getpropertyvalue e1 "area" "length" "numverts") (xdrx-getpropertyvalue e2 "area" "length"
  "numverts"
   )
      )
    )
    (if (and
  (setq edge (xdrx-geom-bpoly dynpt ss))
  (not (_equal edge old-edge))
)
      (progn
(xdrx-entity-delete old-edge (xdrx-getpropertyvalue hch "assocobjids") hch)
(setq old-edge edge
      hch (xdrx_hatch_make old-edge)
)
(xdrx_hatch_setpattern hch patten)
(xdrx_hatch_setscale hch scale)
(xdrx-entity-delete (xdrx-getpropertyvalue hch "assocobjids"))
      )
    )
  )
  (setq patten "grass"
scale 1.0
  )
  (xdrx-begin)
  (xd::doc:getdouble
    (xdrx-string-multilanguage
      "\n输入缝隙容差"
      "\nInput Gap Tolerance"
    )
    "#xd-var-global-gap-tol"
    (xd::doc:getpickboxheight)
  )
  (xdrx-sysvar-push (list "boextlen" #xd-var-global-gap-tol))
  (if (setq ss (xdrx-ssget (xdrx-string-multilanguage "\n选择曲线<退出>:" "\nSelect Curves<Exit>:") '
   ((0 . "*line,arc,ellipse,circle"))
       )
      )
    (progn
      (setq box (xdrx-entity-box ss)
    minl (apply
   'min
   (xdrx-getpropertyvalue (xdrx-getpropertyvalue box "allLineSegs") "length")
)
    scale (XD::Hatch:GetSclByGap patten (/ minl 20.0))
      )
      (xdrx-pointmonitor "_callback")
      (getpoint (xdrx-string-multilanguage "\n拾取内部点:" "\nPick internal point:"))
      (xdrx-pointmonitor)        ; (*error* nil)
    )
  )
  (xdrx-sysvar-pop)
  (xdrx-end)
  (princ)
)
83
AutoLISP (Vanilla / Visual) / Re: BricsCAD Bundle and Plugins Path
« Last post by Tharwat on April 10, 2024, 02:55:16 AM »
Like "Alive" you need to write to registry about where your custom code is, I am sure was asked on Bricscad forum. Will see if can find.
He said the contrary.
I don’t want to write to the registry.
Besides that, your procedure is too old and must level up your work than unzipping and using LOAD function so try to work hard on yourself than just spamming every thread all around lisp forums which makes reading threads very boring.

84
XDRX-API / [XDrX-PlugIn(140)] Dimension rounding
« Last post by xdcad on April 09, 2024, 11:07:30 PM »
Code: [Select]
(defun c:xdtb_dimrnd1 ( / ss v)
  (if (and (xdrx-initssget
     (xdrx-string-multilanguage
       "\n请选择尺寸值要取整的尺寸标注<退出>:"
       "\nSelect Dimension<Exit>:"
     )
   )
   (setq ss (xdrx-ssget '((0 . "*dimension"))))
      )
    (progn (xdrx-initget "1 2 3 4 5")
   (if (not #xd-var-global-dimrnd)
     (setq #xd-var-global-dimrnd 1)
   )
   (if (setq
v (getkword
     (xdrx-prompt
       (xdrx-string-formatex
(xdrx-string-multilanguage
   "\n输入取整值[1(1)/5(2)/10(3)/50(4)/100(5)]<%d>:"
   "\nEnter the rounding value [1(1)/5(2)/10(3)/50(4)/100(5)]<%d>:"
)
#xd-var-global-dimrnd
       )
       t
     )
   )
       )
     (setq #xd-var-global-dimrnd v)
   )
   (cond ((= #xd-var-global-dimrnd "1") (setq v 1.0))
((= #xd-var-global-dimrnd "2") (setq v 5.0))
((= #xd-var-global-dimrnd "3") (setq v 10.0))
((= #xd-var-global-dimrnd "4") (setq v 50.0))
((= #xd-var-global-dimrnd "5") (setq v 100.0))
(t (setq v 1.0))
   )
   (xdrx-entity-setproperty ss "dimrnd" v)
    )
  )
  (princ)
)
85
XDRX-API / [XDrX-PlugIn(139)] Polyline dimensioning
« Last post by xdcad on April 09, 2024, 10:53:50 PM »

Code: [Select]
(defun c:XDTB_DIMPL
       ( / ang ang1 e edim gap msg myerr olderr p1 p2 pos pts scl ss tf unit x)
  (defun myerr (msg)
    (princ (strcat "\n" msg))
    (xdrx_end)
    (setq *error* olderr)
    (princ)
  )
  (defun _dim (e)
    (setq pts (xdrx_getpropertyvalue e "vertices"))
    (if (xdrx_curve_isclosed e)
      (setq pts (xd::pnts:close pts))
    )
    (if (XD::Pnts:isClockWise pts)
      (setq pts (reverse pts))
    )
    (setq pts (xd::list:snakepair pts))
    (mapcar '(lambda (x)
       (setq p1   (car x)
     p2   (cadr x)
     ang  (angle p1 p2)
     ang1 (- ang (/ pi 2.0))
     pos  (polar
    p1
    ang1
    (* scl
       (+ (xd::symbol:get '#XD_GLOBAL_VAR_DIMJieXianGap)
  (xd::symbol:get '#XD_GLOBAL_VAR_DIMJieXianLength)
       )
    )
  )
       )
       (setq edim (xdrx_dimension_makerotate p1 p2 pos ang))
       (if (/= scl 1.0)
(xdrx_setpropertyvalue (entlast) "dimscale" scl)
       )
       (xdrx_setpropertyvalue
(entlast)
"dimexo"
(xd::symbol:get '#XD_GLOBAL_VAR_DIMJieXianGap)
       )
     )
    pts
    )
  )
  (xdrx_begin)
  (xdrx_sysvar_push '("osmode" 33))
  (setq olderr *error*)
  (setq *error* myerr)
  (setq tf t)
  (setq unit (xd::var:getdrawingunit))
  (if (not (xd::symbol:get '#XD_GLOBAL_VAR_DIMJieXianLength))
    (if (= unit 0)
      (xd::symbol:put '#XD_GLOBAL_VAR_DIMJieXianLength 15)
      (xd::symbol:put '#XD_GLOBAL_VAR_DIMJieXianLength 1500)
    )
  )
  (if (not (xd::symbol:get '#XD_GLOBAL_VAR_DIMJieXianGap))
    (if (= unit 0)
      (xd::symbol:put '#XD_GLOBAL_VAR_DIMJieXianGap 15)
      (xd::symbol:put '#XD_GLOBAL_VAR_DIMJieXianGap 500)
    )
  )
  (setq scl (XD::Var:GetScaleRatio))
  (defun _keyword (keyword)
    (if (setq
  gap (getreal (xdrx_prompt
(xdrx-string-multilanguage "\n界线距离<" "\nExtension Distance<")
(xd::symbol:get '#XD_GLOBAL_VAR_DIMJieXianGap)
">:"
t
       )
      )
)
      (xd::symbol:put '#XD_GLOBAL_VAR_DIMJieXianGap gap)
    )
    (if (setq gap
       (getreal (xdrx_prompt
  (xdrx-string-multilanguage "\n界线长度<" "\nExtension Length<")
  (xd::symbol:get '#XD_GLOBAL_VAR_DIMJieXianLength)
  ">:"
  t
)
       )
)
      (xd::symbol:put '#XD_GLOBAL_VAR_DIMJieXianLength gap)
    )
    (xdrx_prompt
      (xdrx-string-formatex
(xdrx-string-multilanguage
  "\n** 当前设置:界线距离(%.1f) | 界线长度(%.1f) **"
  "\n** Current settings: Extension Distance (%.1f) | Extension Length (%.1f) **"
)
(xd::symbol:get '#XD_GLOBAL_VAR_DIMJieXianGap)
(xd::symbol:get '#XD_GLOBAL_VAR_DIMJieXianLength)
      )
    )
  )
  (xd::dim:init)
  (while (and (xdrx_prompt
(xdrx-string-formatex
  (xdrx-string-multilanguage
    "\n** 当前设置:界线距离(%.1f) | 界线长度(%.1f) **"
    "\n** Current settings: Extension Distance (%.1f) | Extension Length (%.1f) **"
  )
  (xd::symbol:get '#XD_GLOBAL_VAR_DIMJieXianGap)
  (xd::symbol:get '#XD_GLOBAL_VAR_DIMJieXianLength)
)
      )
      (xdrx_initssget
(xdrx-string-multilanguage "\n选取要标注的多段线[设置(BE)]<退出>:""\nSelect the polyline [Settings (BE)]<Exit>:")
"BE"    ""
"_keyword"    ""
       )
      (setq ss (xdrx_ssget '((0 . "*polyline"))))
)
    (mapcar '(lambda (x) (_dim x)) (xdrx_pickset->ents ss))
  )
  (setq *error* olderr)
  (xdrx_sysvar_pop)
  (xdrx_end)
  (princ)
)
86
XDRX-API / [XDrX-PlugIn(138)] Dimension sum verification
« Last post by xdcad on April 09, 2024, 10:34:05 PM »

Total dimension verification, taking into account various factors such as manual modification and dimension rounding.

Code: [Select]
(defun c:xdtb_tjdiml (/ #dimclrt #dimdec #dimscale #dimtxsty #dimtxt ss txt val x)
  (xdrx-begin)
  (if (setq ss (xdrx-ssget (xdrx-string-multilanguage "\n选择核查的尺寸标注<退出>:"
      "\nSelect dimensions for verification <Exit>:"
   ) '((0 . "dimen*"))
       )
      )
    (progn
      (setq val 0.0)
      (mapcar
'(lambda (x)
   (xdrx-getpropertyvalue x "dimtxt" "dimscale" "dimtxsty" "dimclrt" "dimdec")
   (cond
     ((/= (setq txt (xdrx-getpropertyvalue x "dimensiontext"))
  ""
      )
       (setq val (+ val (atof txt)))
     )
     (t
       (setq val (+ val (xdrx-math-roundto (xdrx-getpropertyvalue x "measurement")
   (xdrx-getpropertyvalue x "dimrnd")
)
)
       )
     )
   )
)
(xdrx-pickset->ents ss)
      )
      (xdrx-sysvar-push '("dimzin" 0))
      (setq txt (xdrx-text-make '(0 0 0) (setq val (rtos val 2 #dimdec))
(xdrx-getpropertyvalue #dimtxsty "name") (* #dimscale #dimtxt)
)
      )
      (xdrx-setpropertyvalue txt "color" #dimclrt)
      (xdrx-prompt (xdrx-string-multilanguage "\n标注总和:" "\nDimension Total Sum:") val)
      (xd::drag:freemove txt (xd::geom:get9pt txt 2) (+ 1 0) 0 t)
      (xdrx-sysvar-pop)
    )
  )
  (xdrx-end)
  (princ)
)
87
XDRX-API / [XDrX-PlugIn(137)] batch, Intelligent outsourcing dimension creation
« Last post by xdcad on April 09, 2024, 10:18:26 PM »
1. Intelligent, batch processing, full dwg processing does not need to be displayed on the screen.

2. The generated outsourcing dimension entity type is the same as the single-row continuous original annotation, and the starting point is.

3. Single rows composed of different types (alignment, corner) to generate corner outsourcing dimensions.

4. Intelligently determine whether outsourcing dimensions have been generated, and those that have been generated will not be processed.
. . . . .

Code: [Select]
(defun c:xdtb_dimwb (/ #dimlinepoint #rotation
     #xline1point      #xline2point
     #ydir dimlinepnt  ents i
     j ss      x
    )
  (xdrx-begin)
  (xd::doc:getdouble
    (xdrx-string-multilanguage
      "\n外包尺寸偏移距离"
      "\nOutsourcing dim offset distance"
    )
    "#xd-var-global-offset"
    6.0
  )
  (if (setq ss (xdrx-ssget
(xdrx-string-multilanguage
   "\n选择生成外包尺寸的标注对象<退出>:"
   "\nSelect the dimension objects <Exit>:"
)
'((0 . "*dim*"))
       )
      )
    (progn
      (xdrx-runtime t)

      (if (setq ents (xd::dim:group ss 3))
(progn
  (setq i 0
j 0
  )
  (xdrx_ui_prgdlgbar
    (xdrx-string-multilanguage "处理中: " "Processing: ")
    (length ents)
    0.5
    "center"
  )
  (mapcar
    '(lambda (x)
       (xdrx_ui_prgdlgbar T)
       (if (= (length x) 1)
(progn
   (setq j (1+ j))
   (setq x (car x))
   (xdrx-getpropertyvalue
     (car x)
     "xline1point"
     "dimlinepoint"
     "ydir"
     "xdir"
     "rotation"
   )
   (xdrx-getpropertyvalue (last x) "xline2point")
   (setq
     dimlinepnt
      (mapcar '+
      #dimlinepoint
      (xdrx-vector-product
#ydir
(- #xd-var-global-offset)
      )
      )
   )
   (if (or (xdrx-object-iskindof (car x) "acdbrot*")
   (xdrx-object-iskindof (last x) "acdbrot*")
       )
     (progn (xdrx-dimension-makerotate
      #xline1point
      #xline2point
      dimlinepnt
      #rotation
    )
     )
     (progn (xdrx-dimension-makealign
      #xline1point
      (xdrx-getpropertyvalue
(xdrx-getpropertyvalue (last x) "xline2")
"getclosestpointto"
#xline1point
t
      )
      dimlinepnt
    )
     )
   )
   (xdrx-entity-matchprop (car x) (entlast))
)
       )
     )
    ents
  )
  (setq info (if (> j 0)
       (xdrx-string-multilanguage
"生成了外包尺寸."
"Outsourcing dimensions generated."
       )
       (xdrx-string-multilanguage
"没有生成外包尺寸."
"Outsourcing dimensions were not generated."
       )
     )
  )
  (xdrx-prompt
    (xdrx-string-formatex
      (xdrx-string-multilanguage
"\n发现了 %d 组联排标注组,找到 %d 个单排标注,%s"
"\nFound %d Groups of linked Dim Groups, found %d single-row Dim Groups, %s"
      )
      (length ents)
      j
      info
    )
  )
)
      )
      (xdrx_ui_prgdlgbar)
      (xdrx_prompt
(xdrx-string-multilanguage
  "\n执行时间:"
  "\nExecution time:"
)
(xdrx_runtime)
      )
    )
  )
  (xdrx-end)
  (princ)
)
88
CAD General / Re: CAD File is 63MB with images
« Last post by Shay Gaghe on April 09, 2024, 09:43:34 PM »
hi
im using this tool

https://apps.autodesk.com/ACD/en/Detail/Index?id=3955584821612203149&appLang=en&os=Win32_64

its reduces the master file and all its xreferences
89
AutoLISP (Vanilla / Visual) / Re: BricsCAD Bundle and Plugins Path
« Last post by BIGAL on April 09, 2024, 08:05:32 PM »
Like "Alive" you need to write to registry about where your custom code is, I am sure was asked on Bricscad forum. Will see if can find.

I still use a Custom directory and just set the support path to suit. I use a install.lsp that unzips all the files to a destination directory adds support paths and menus etc. The zip is like 30Mb as it has multiple company dwt and dwgs.

Des = Fas etc.

Oh yeah trying to remember can use mnl to load lisps like using startup suite (load "xxx shortcuts")
90
AutoLISP (Vanilla / Visual) / Re: 2025 new Enterprise package.
« Last post by BIGAL on April 09, 2024, 07:59:38 PM »
just a comment we just copied the Acad Desktop Icon and edited the properties, changing the startup to run a different saved profile. /p "Jeffs".

So the user had a laptop, ran icon Office when in the obvious "Office" and Laptop when outside of office.
Pages: 1 ... 7 8 [9] 10