Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 12/29/2023 in all areas

  1. Like Steven P something like this. I am pretty sure need a CCW CW check, I only made block 40M for testing. How you going making sample blocks ? Need names to complete this. ; bY AlanH DEC 2023 (defun c:xwire ( / oldsnap oldaunits obj ent ent2 pt1 pt2 pt) (setq oldsnap (getvar 'osmode)) (setvar 'osmode 0) (setq oldaunits (getvar aunits)) (setvar 'aunits 3) (setq ent (entsel "\nPick pline at break pt")) (setq obj (vlax-ename->vla-object (car ent))) (setq start (vlax-curve-getstartPoint obj)) (setq end (vlax-curve-getEndPoint obj)) (setq pt (cadr ent)) (setq pt (vlax-curve-getclosestpointto obj pt)) (setq ang (angle start end)) (setq pt1 (polar pt ang 0.5)) (setq pt2 (polar pt (+ ang pi) 0.5)) (command "Break" pt1 pt2) (setq ent2 (entlast)) (command "-insert" "40M" "S" 1.0 pt2 ang) (command "explode" (entlast)) (command "join" ent (entlast) ent2 "") (setvar 'osode oldsnap) (setvar 'aunits oldaunits) (princ) ) (c:xwire) Front end, need block names.
    2 points
  2. Got to apply these to your own circumstances. The < > are just to highlight what is expected so it <Filename> might be replaced be "11" The second option should work if you replace the details with your specific LISP file name instead of a.lsp. You might need to use double \\ instead of single in the file path
    1 point
  3. Another alternative is create load of small LISPs in a single file, where the LISP name is what you want, and take away the "c:" prefix from the actual LISP to use - should be fairly fool proof if not the most elegant. Load this file at start-up (defun c:testthis ( / ) (load "....filepath....\\a.lsp" "a.lsp Failed to Load") ;;Using full path and not variable (testthis) )
    1 point
  4. I think: (autoload "<fileName>" '("<LISP Name 1>" "<LISPName 2>")) ; where <LISPName x> are LISPs contained in <filename> The file should be saved in your trusted locations, no need to include the extension '.LSP' I think, might be wrong
    1 point
  5. (autoload "COPY0" '("COPY0")) (autoload "COPYCOMMAND" '("ZZZ")) (autoload "COVER" '("COVER")) (autoload "DIMFLIP" '("DIMFLIP")) (autoload "DRAWXFALL" '("DRAWXFALL")) (autoload "DRAWPIPE" '("DRAWPIPE")) (autoload "EDITRL" '("EDITRL")) Load on demand is easy just put in a startup lisp that is automatically loaded. Thinking some more though easier to put in a menu as an option. Load a lisp with all the defuns in it. I would make something like type A30 on command line and it runs a lisp that splits the A & 30. Look at attached code it does circles, fillet, offset etc F123 C345. Again load as required, if only every now and then. fillet reactor.lsp
    1 point
  6. Something that is for something else, but will do as a starter here: Removes a segment of polyline (defun c:RemovePortion ( / pt1 pt2 MyPL MySegment MySegPts) (defun ODlinetopt ( MyLine TrimPt1 TrimPt2 / MyLineDef MyLineEndA MyLineEndB Pt1Dist Pt2Dist TempPT MyLineA MyLineB) (command "zoom" "Object" MyLine "") (command "zoom" "0.95x") (setq MyLineDef (entget MyLine)) (setq MyLineEndA (cdr (assoc 10 MyLineDef))) (if (= (cdr (assoc 0 MyLineDef)) "LINE") (setq MyLineEndB (cdr (assoc 11 MyLineDef))) (setq MyLineEndB (cdr (assoc 10 (reverse MyLineDef)))) ) ;;sort trimpts according to distance from end A (setq Pt1Dist (vlax-curve-getdistatpoint MyLine (osnap TrimPt1 "nea")) ) (setq Pt2Dist (vlax-curve-getdistatpoint MyLine (osnap TrimPt2 "nea")) ) (if ( > Pt1Dist Pt2Dist) (progn (setq TempPt TrimPt1) (setq TrimPt1 TrimPt2) (setq TrimPt2 TempPt) ) ;end progn ) ;end if (command "breakatpoint" MyLine TrimPt1) (setq MyLineA (entlast)) (command "breakatpoint" MyLineA TrimPt2) (setq MyLineB (entlast)) (command "zoom" "Previous") (command "zoom" "Previous") MyLineA ) ;; Ref Lee Mac ;; (defun mAssoc ( key lst / result ) ;; (foreach x lst ;; (if (= key (car x)) ;; (setq result (cons (cdr x) result)) ;; ) ;; ) ;; (reverse result) ;; ) (setq thisdrawing (vla-get-activedocument (vlax-get-acad-object))) (vla-startundomark thisdrawing) (setq pt1 (getpoint "Get point 1")) (setq pt2 (getpoint "Get point 1")) (setq MyPL (car (entsel "Get Line"))) (setq MySegment (ODlinetopt MyPl Pt1 Pt2) ) ;; (setq MySegPts (mAssoc 10 (entget MySegment))) (entdel MySegment) (vla-endundomark thisdrawing) )
    1 point
  7. For Nikon you can not use "." in the value you need to use "-" so F123-45 will work. The "." is a valid character in the input and gets treated different to a decimal point. So A30 would set the snapang to 30, then ask for pt1 pt2. If you get stuck just ask, can have 26 functions A-Z, C, O & F used.
    0 points
×
×
  • Create New...