Jump to content

Leaderboard

Popular Content

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

  1. mhupp ok for Bricscad (setq lay "DEFAULT") (setq ent (entget (tblobjname "layer" lay))) (entmod (subst (cons 62 30) (assoc 62 ent) ent))
    2 points
  2. Maybe something like this? (defun f ( l / n r y ) (foreach x l (setq n (if (= "true" (strcase (cadr x) t)) 1 0) x (car x) ) (if (setq y (vl-some '(lambda ( y ) (if (wcmatch x (strcat (car y) "*")) y)) r)) (setq r (subst (list (car y) (+ n (cadr y)) (1+ (caddr y))) y r)) (setq r (cons (list (substr x 1 (vl-string-position 95 x)) n 1.0) r)) ) ) (mapcar '(lambda ( x ) (list (car x) (apply '/ (cdr x)))) r) ) _$ (f lst) (("H603" 0.727273) ("H602" 1.0) ("H601" 1.0))
    1 point
  3. I had to change gears at work and will look at this new code as soon as possible. Wanted to say thank you no matter what...
    1 point
  4. I made a 3 click version of something that sounds like it could do what you require, perhaps with a few changes. For one thing you don't need the scale factor. Replace (setq sc (getreal "\Set scale factor: ")) by (setq sc 1.0) See if this helps, tell me if it doesn't
    1 point
  5. Test this out see if the commented entmod works. comment out the command line below to test. This first lists all xref layers. then checks them for AH or ME in their name. (defun C:color-xref (/ lay name match c) (vl-load-com) (vlax-for lay (vla-get-layers (vla-get-activedocument (vlax-get-acad-object))) (if (wcmatch (setq name (vla-get-name lay)) "*|*") (setq match (cons name match)) ) ) (setvar 'cmdecho 0) (foreach lay match (cond ((wcmatch lay "*AH*|*") (setq ent (entget (tblobjname "layer" lay))) (entmod (subst (cons 62 10) (assoc 62 ent) ent)) ) ((wcmatch lay "*ME*|*") (setq ent (entget (tblobjname "layer" lay))) (entmod (subst (cons 62 15) (assoc 62 ent) ent)) ) ) ) (setvar 'cmdecho 1) (princ) )
    1 point
  6. Since the string to be found is already being passed an argument to your function, you can 'hardcode' it by simply defining another function which evaluates your function with a hardcoded string, e.g.: (defun c:test ( ) (chkmtxtstr "MyTextString") ) Though, if you're happy with a case-sensitive match and assuming the MText content has no formatting and does not straddle multiple DXF group 3 entries, the code can become much simpler - consider the following: (defun find ( str ) (ssget "_X" (list '(0 . "MTEXT") (cons 1 (strcat "*" str "*")))) ) Since the above will return a selection set, you can call it in the following way: (defun c:test ( / sel ) (if (setq sel (find "YourString")) (command "_.change" sel "" "_p" "_la" "0" "_c" "ByLayer" "") ) (princ) )
    1 point
  7. If the objects in the model space are being moved without changing the scale or rotation, then I use this to change (pan) viewports view in all layouts or current layout only: VPML
    1 point
×
×
  • Create New...