Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 11/17/2023 in all areas

  1. This is what you want it is metric. ;Calculates level of a point in cross or long sections ; BY alanh 2014 (setvar "cmdecho" 0) (princ "\n To run just type SRL") ;;-------------------=={ Parse Numbers }==--------------------;;` ;; ;; ;; Parses a list of numerical values from a supplied string. ;; ;;------------------------------------------------------------;; ;; Author: Lee Mac, Copyright © 2011 - www.lee-mac.com ;; ;;------------------------------------------------------------;; ;; Arguments: ;; ;; s - String to process ;; ;;------------------------------------------------------------;; ;; Returns: List of numerical values found in string. ;; ;;------------------------------------------------------------;; (defun LM:ParseNumbers ( s ) ( (lambda ( l ) (read (strcat "(" (vl-list->string (mapcar (function (lambda ( a b c ) (if (or (< 47 b 58) (and (= 45 b) (< 47 c 58) (not (< 47 a 58))) (and (= 46 b) (< 47 a 58) (< 47 c 58)) ) b 32 ) ) ) (cons nil l) l (append (cdr l) (list nil)) ) ) ")" ) ) ) (vl-string->list s) ) ) (defun c:SRL () (setq olddimzin (getvar "dimzin")) (setvar "dimzin" 0) (if (= dwgscale nil) (setq dwgscale (/ 1000.0 (getreal "\n enter vertical scale "))) ) ;(setq datum (getreal "\n Enter datum level ")) (setq datum (car (LM:ParseNumbers (cdr (assoc 1 (entget (car (entsel "\nPick datum text")))))))) (setq test 1) (setq pt1 (cadr (getpoint "\npick datum"))) (while (= test 1) (setq pt2 (cadr (getpoint "\npick point"))) (setq dist (/(abs (- pt1 pt2)) dwgscale)) (setq en1 (car (entsel "\nSelect text number:" ))) (if (/= en1 nil) (progn (setq tent (entget en1)) (setq a (+ dist datum)) (setq a (rtos a 2 3)) (setq el (subst (cons 1 a) (assoc 1 tent) tent)) (entmod el) );progn (princ "\nplease pick again"); else );if ); while t (setq el nil en nil a nil en1 nil test nil) (setvar "cmdecho" 1) (setvar "dimzin" olddimzin) (princ) ) ;ends main defun
    1 point
  2. Lee Mac's code - its Great! Working good
    1 point
  3. I'd typically opt for something like - (nth <param> (mapcar 'cdr (vl-remove-if-not '(lambda ( x ) (= 42 (car x))) <dxf-data>)))
    1 point
  4. Update the ssget with the block name should do the trick (if (setq sset (ssget (list (cons 0 "INSERT") (cons 2 "BLOCK NAME") (cons 66 1))))
    1 point
  5. I'm not sure but I think that the layers all turn on in block editor - they do for me generally. What you could do is 'lock' the layers that you want to keep, unlock the layers you want to delete - that setting carries through to block editor. Then delete the unwanted entities - everything you want is on locked layers and should be OK. Note that with this, for example, any block that is on an unlocked layer will be deleted even if it contains entities that are on locked layers, so be wary, but it is good for lines, text, arcs......
    1 point
  6. I eyeballed the location of the fit points and the spacing was done a bit by experience. Yes, there's some trial and error involved.
    1 point
  7. Start by placing a copy of the image into AutoCAD and scale it to the correct size and lock its layer. Using the spline command create a curve using the fit points method. In general you should use as few fit points as possible and you may need more fit point where the curvature has a smaller radius. Here's my first attempt. Not the location of the fit points. The curve needs some editing in this area. You may not be able to get the desired curve by just moving fit points. For example: Select the spline and pick the Control Vertices method for editing Experiment with moving the CVs. If you need more local editing of the curve use the SPLINEDIT command to add additional CVs.
    1 point
×
×
  • Create New...