• Add-On’s
  • Download
  • History of AutoLISP
  • Lisp Resources
  • Run an AutoLISP

LispBox

~ This blog was initially created for people, who love autolisp routines, as I love it.

Monthly Archives: September 2015

CHange MLine Style

21 Monday Sep 2015

Posted by danglar71 in Mline

≈ 4 Comments

; BeekeeCZ 2015/09
; CHange MLine style
(vl-load-com)
(defun c:CML ( / *error* LM:UniqueFuzz nVAR oVAR adoc ss edo edn a tmp vrts)
; ----
(defun *error* (errmsg)
(if (not (wcmatch errmsg "Function cancelled,quit / exit abort,console break,end"))
(princ (strcat "\nError: " errmsg)))
(mapcar 'setvar nVAR oVAR)
(vla-endundomark adoc)
(princ))
;----- Lee Mac, http://www.lee-mac.com/uniqueduplicate.html
(defun LM:UniqueFuzz (l f)
(if l (cons (car l)
(LM:UniqueFuzz (vl-remove-if (function (lambda ( x ) (equal x (car l) f))) (cdr l))
f))))
; ----
; ----
(vla-startundomark (setq adoc (vla-get-activedocument (vlax-get-acad-object))))
(setq oVAR (mapcar 'getvar (setq nVAR '(CMDECHO OSMODE ORTHOMODE SNAPMODE BLIPMODE CMLSTYLE CMLJUST CMLSCALE))))
(if (and (princ "\nNeed MLINEs,")
(setq ss (ssget ":L" '((0 . "MLINE"))))
(setq #nstyle (if (= "" (setq tmp (getstring (strcat "\nChange style to : ")))) ; Default style: Replace N/A
(cond (#nstyle)
(nil)) ; Default style: Replace nil
tmp))
(dictsearch (cdr (assoc -1 (dictsearch (namedobjdict) "ACAD_MLINESTYLE"))) #nstyle)
(mapcar 'setvar '(CMDECHO OSMODE ORTHOMODE SNAPMODE BLIPMODE) (list 0 0 0 0 0))
)
(progn
(repeat (setq i (sslength ss))
(setq edo (entget (ssname ss (setq i (1- i))))
vrts (LM:UniqueFuzz (mapcar 'cdr (vl-remove-if-not '(lambda (x) (member (car x) '(11))) edo)) 0.001))
(mapcar 'setvar '(CMLSTYLE CMLJUST CMLSCALE) (list #nstyle (cdr (assoc 70 edo)) (cdr (assoc 40 edo))))
(command "_.MLINE") (apply 'command vrts) (command)
(setq edn (entget (entlast)))
(entmod (foreach e (vl-remove 'nil (mapcar '(lambda (x) (assoc x edo)) '(6 8 62 39 43 48 370 71)))
(setq edn (if (setq a (assoc (car e) edn))
(subst e
a
edn)
(append edn
(list e))))))
)
(command "_.ERASE" ss ""))
(cond ((not ss)
(princ "No MLINEs selected."))
((not (dictsearch (cdr (assoc -1 (dictsearch (namedobjdict) "ACAD_MLINESTYLE"))) #nstyle))
(princ (strcat #nstyle " mline style does not exists/loaded."))
(setq #nstyle nil)))
)
(*error* "end")
)
(c:cml)

Measure Geometry (Distance) by Multiple Points

20 Sunday Sep 2015

Posted by danglar71 in Counting

≈ Leave a comment

(defun C:MD ( / oldOrt oldOrt a )
(setq oldOrt (getvar "ORTHOMODE"))
(setvar "ORTHOMODE" 1)
(setq oldOrt (getvar "OSMODE"))
(setvar "OSMODE" 0)
(setvar "cmdecho" 0)
(setq a (getpoint "First point: "))
(COMMAND "measuregeom" "d" a "m")
(setvar "ORTHOMODE" oldOrt)
(setvar "OSMODE" oldOrt)
(princ)
)
(c:md)

Recent Posts

  • Это наша плата за трусость
  • Set the Default Application to open DWG Files
  • Draw “Heat Grid” (Lee Mac)
  • PROGRAM FOR SPRINKLER DISTRIBUTION
  • How to remove Frames around blocks

Recent Comments

Wilmer Lacayo on Draw Centroid (center of gravi…
Jun on Convert Polylines to Leaders i…
Adel on HVAC Draw Branch Duct
danglar71 on Draw “Heat Grid” (…
IOAN VLAD on Draw “Heat Grid” (…

Archives

  • January 2021
  • March 2020
  • February 2020
  • January 2020
  • October 2019
  • September 2019
  • August 2019
  • July 2019
  • June 2019
  • May 2019
  • April 2019
  • February 2019
  • January 2019
  • December 2018
  • November 2018
  • October 2018
  • September 2018
  • August 2018
  • July 2018
  • June 2018
  • April 2018
  • March 2018
  • February 2018
  • January 2018
  • December 2017
  • November 2017
  • August 2017
  • July 2017
  • June 2017
  • May 2017
  • April 2017
  • March 2017
  • February 2017
  • January 2017
  • December 2016
  • November 2016
  • October 2016
  • September 2016
  • August 2016
  • July 2016
  • June 2016
  • May 2016
  • April 2016
  • March 2016
  • February 2016
  • January 2016
  • December 2015
  • November 2015
  • October 2015
  • September 2015
  • August 2015
  • July 2015
  • June 2015
  • May 2015
  • April 2015
  • March 2015
  • February 2015
  • January 2015
  • December 2014
  • November 2014

Categories

  • 3D
  • Annonymous Blocks
  • Attribute
  • Batch
  • Blocks
  • Books
  • Common
  • Coordinates
  • Counting
  • dimmensions
  • draw
  • Export
  • Fractal
  • Hatch
  • HVAC
  • Images
  • Import
  • Info
  • Isometric
  • Layers
  • Layouts
  • Lisp Collection 2014
  • Mline
  • Pdf
  • Pipes
  • plot
  • Points
  • Protect
  • Text
  • Tips (English)
  • Tips (Russian)
  • ucs
  • Utilites
  • view
  • Vport
  • Xref

Recent Posts

  • Это наша плата за трусость
  • Set the Default Application to open DWG Files
  • Draw “Heat Grid” (Lee Mac)
  • PROGRAM FOR SPRINKLER DISTRIBUTION
  • How to remove Frames around blocks

Recent Comments

Wilmer Lacayo on Draw Centroid (center of gravi…
Jun on Convert Polylines to Leaders i…
Adel on HVAC Draw Branch Duct
danglar71 on Draw “Heat Grid” (…
IOAN VLAD on Draw “Heat Grid” (…

Archives

  • January 2021
  • March 2020
  • February 2020
  • January 2020
  • October 2019
  • September 2019
  • August 2019
  • July 2019
  • June 2019
  • May 2019
  • April 2019
  • February 2019
  • January 2019
  • December 2018
  • November 2018
  • October 2018
  • September 2018
  • August 2018
  • July 2018
  • June 2018
  • April 2018
  • March 2018
  • February 2018
  • January 2018
  • December 2017
  • November 2017
  • August 2017
  • July 2017
  • June 2017
  • May 2017
  • April 2017
  • March 2017
  • February 2017
  • January 2017
  • December 2016
  • November 2016
  • October 2016
  • September 2016
  • August 2016
  • July 2016
  • June 2016
  • May 2016
  • April 2016
  • March 2016
  • February 2016
  • January 2016
  • December 2015
  • November 2015
  • October 2015
  • September 2015
  • August 2015
  • July 2015
  • June 2015
  • May 2015
  • April 2015
  • March 2015
  • February 2015
  • January 2015
  • December 2014
  • November 2014

Categories

  • 3D
  • Annonymous Blocks
  • Attribute
  • Batch
  • Blocks
  • Books
  • Common
  • Coordinates
  • Counting
  • dimmensions
  • draw
  • Export
  • Fractal
  • Hatch
  • HVAC
  • Images
  • Import
  • Info
  • Isometric
  • Layers
  • Layouts
  • Lisp Collection 2014
  • Mline
  • Pdf
  • Pipes
  • plot
  • Points
  • Protect
  • Text
  • Tips (English)
  • Tips (Russian)
  • ucs
  • Utilites
  • view
  • Vport
  • Xref

Blog at WordPress.com.

Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy