Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 03/26/2022 in all areas

  1. Try this quickie & untested program. (defun c:Test (/ int sel ent get tag ohd lst new) ;; Tharwat - Date: 26.Mar.2022 ;; (and (princ "\nSelect attributed blocks to replace D1 & D2 with OHd valye : ") (setq int -1 sel (ssget '((0 . "INSERT") (66 . 1)))) (while (setq int (1+ int) ent (ssname sel int)) (setq new ent lst nil) (while (not (eq (cdr (assoc 0 (setq get (entget (setq ent (entnext ent)))))) "SEQEND")) (setq lst (cons (list (cdr (assoc 2 get)) (cdr (assoc 1 get))) lst)) ) (and (= (length lst) 3) (setq ohd (assoc "OHd" lst)) (while (not (eq (cdr (assoc 0 (setq get (entget (setq new (entnext new)))))) "SEQEND")) (and (wcmatch (setq tag (cdr (assoc 2 get))) "D1,D2") (entmod (subst (cons 1 ohd) (assoc 1 get) get)) ) ) ) ) ) (princ) )
    1 point
  2. Those parameters are specific for Dynamic Blocks - look here : http://www.lee-mac.com/dynamicblockfunctions.html
    1 point
  3. Search for ConcaveHull - topic was posted at www.autodesk.com - Customization / AutoLisp-VisualLisp... Participants : Miljenko Hatlak, me (Marko Ribar), ... (I can't recall)
    1 point
  4. You can line up station 0+00 in the plan view of the driveway with 0+00 in the grid and that's all. Everything after that is based upon the stationing. Did you not follow what I wrote in my example previously? When it comes to plotting features shown in the plan view, in the profile grid, treat the plan view as if it were a straight line.
    1 point
  5. props @Steven P But if they cant even take the time to type a few sentences I'm out.
    1 point
  6. Yes the timer is unreliable What you can do: (defun MsgBox (title options message time / WshShell) (setq WshShell (vlax-create-object "WScript.Shell")) (vlax-invoke WshShell 'Run (strcat "mshta.exe vbscript:close(CreateObject(\"WScript.Shell\").Popup(\"" message "\"," (itoa time) ",\"" title "\"," (itoa options)"))" ) ) (vlax-release-object WshShell) ) That always returns 0, so cannot detect which button was pressed. But this shouldn't have to be a problem when you only have one button.
    1 point
  7. A further version thanks to roy_043 ;Plots layouts by range ; By Alan H Feb 2014 (defun AH:pltlays ( / pdfname lay numlay numend) (SETVAR "PDMODE" 0) (setvar "fillmode" 1) (setvar "textfill" 1) (setq plotnames '()) (if (not AH:getval2) (load "getvals")) (ah:getval2 "Enter start tab number" 6 4 "Enter end tab number" 6 4) (setq numlay (ATOI val1)) (setq numend (ATOI val2)) (setq len (+ (- numend numlay) 1)) (setq dwgname (GETVAR "dwgname")) (setq lendwg (strlen dwgname)) (setq dwgname (substr dwgname 1 (- lendwg 4))) (repeat len (vlax-for lay (vla-get-Layouts (vla-get-activedocument (vlax-get-acad-object))) (if (= numlay (vla-get-taborder lay)) (setvar "ctab" (vla-get-name lay)) ) ; if (setq pdfname (strcat (getvar "dwgprefix") "pdf\\" dwgname "-" (getvar "ctab") ".pdf" )) ) ; for (setq lay nil) (setvar "textfill" 1) (setvar "fillmode" 1) (COMMAND "-PLOT" "Y" "" "dwg to Pdf" "Iso full bleed A3 (420.00 x 297.00 MM)" "m" "LANDSCAPE" "N" "W" "-6,-6" "807,560" "1=2" "C" "y" "Designlasercolour.ctb" "Y" "n" "n" "n" pdfName "N" "y" ) (setq numlay (+ numlay 1)) (setq plotnames (cons pdfname plotnames)) ) ; end repeat (setq trgfile (strcat (getvar "dwgprefix") "pdf\\" dwgname "-D" val1 "-D" val2 ".pdf")) ) ; defun (AH:pltlays) (if (not combinepdf)(load "mergepdfs")) (combinepdf gsExe plotnames trgFile ) (setq plotnames nil val1 nil val2 nil) (princ) ;MergePdfs ;Merges multiple pdf (or eps) files into one ; ; make a batch file ? ;gs -sDEVICE=pdfwrite \ ; -dNOPAUSE -dBATCH -dSAFER \ ; -sOutputFile=combined.pdf \ ; first.pdf \ ; second.pdf \ ; third.pdf [...] ;Ghostscript ([url]http://www.ghostscript.com/[/url]) can be used to combine PDFs. ; Something like this should work: by Roy_043 (defun KGA_String_Join (strLst delim) (if strLst (apply 'strcat (cons (car strLst) (mapcar '(lambda (a) (strcat delim a)) (cdr strLst)) ) ) "" ) ) (setq gsexe "C:\\Program Files\\gs\\gs9.19\\bin\\gswin64c.exe") ; Note: Existing trgFile will be overwritten. (defun CombinePdf (gsExe srcFileLst trgFile) (startapp (strcat gsExe " " "-sDEVICE=pdfwrite -dBATCH -dNOPAUSE -dQUIET " "-sOutputFile=\"" trgFile "\" " "\"" (KGA_String_Join srcFileLst "\" \"") "\"" ) ) ) GETVALS.lsp
    1 point
×
×
  • Create New...