Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/08/2024 in all areas

  1. @Abrasive still think S1 s2 is about as simple as it gets, popping the dcl can be very fast I use my Multi radio buttons. The 1st time is a little slow as it loads but from then on is fast. It can be set to remember last used so just hit enter or pick. Try it. Easy to add more choices. (if (not AH:Butts)(load "Multi radio buttons.lsp")) ; loads the program if not loaded already (if (= defbut nil)(setq defbut 1)) ; this is needed to set default button (setq ans (ah:butts defbut "V" '("Choose Dim style " "Dim style A" "Dim style B" "Dim style C" "Dim style D" ))) ; ans holds the button picked value as a string (setq defbut but) Multi radio buttons.lsp
    1 point
  2. You could look at something like this that asks for number of chords, you would use say radius values to set how many. In Civil works there are no curved breaklines so a work around is to ask for the max versine value and work back from that. May be the way to go with rather than looking at a radius. ; converts an arc to a series of straights ; By Alan H 2012 ; (vl-load-com) (defun C:arc2chords ( / ss ncrd oldsnap ent endpt obj totlen arclen chrdpt num newpt ang cenpt) (setq oldsnap (getvar "osmode")) (if (= ncrd nil) (setq ncrd (getint "\nEnter number of chords: "))) (setvar 'osmode 512) (while (setq pt (getpoint "Pick Arc or Circle")) (setq ss (ssget pt (list (cons 0 "Arc,Circle")))) (setq obj (vlax-ename->vla-object (ssname ss 0 ))) (if (= "AcDbArc" (vla-get-objectname obj)) (progn (setq endpt (vlax-curve-getEndPoint obj)) (setq totlen (vla-get-ArcLength obj)) (setq arclen (/ totlen ncrd)) (setq chrdpt (vlax-curve-getStartPoint obj)) (setq num 1) (command "_Pline" ) (while (= (getvar "cmdactive") 1 ) (command chrdpt) (repeat ncrd (command (vlax-curve-getPointatDist obj (* arclen num))) (setq num (+ num 1)) ) (command endpt) (command "") ) ) ) (if (= "AcDbCircle" (vla-get-objectname obj)) (progn (setq rad (vla-get-radius obj)) (setq cenpt (vlax-safearray->list (vlax-variant-value (vla-get-center obj)))) (setq totlen (* pi (* 2.0 rad))) (setq ang (/ (* pi 2.) ncrd)) (setq chrdpt (polar cenpt 0.0 rad)) (setq num 1.0) (command "_Pline" ) (while (= (getvar "cmdactive") 1 ) (command chrdpt) (repeat ncrd (command (polar cenpt (* num ang) rad)) (setq num (1+ num)) ) (command "c") ) ) ) (setvar "osmode" oldsnap) ) (princ) ) (c:arc2chords) PS look at the date created.
    1 point
×
×
  • Create New...