Author Topic: Stumped on this routine  (Read 1523 times)

0 Members and 1 Guest are viewing this topic.

Biscuits

  • Swamp Rat
  • Posts: 502
Stumped on this routine
« on: February 15, 2019, 12:44:31 PM »
I'm trying to create a routine that will search all layouts for a specific dimstyle, open the layout in which it resides, and highlight the dimstyle we are looking for. We occasionally have an odd ball dimstyle that missed an update. Qselect and filters work fine but only in the current layout. Here's a line of code I started with:
Code: [Select]
(sssetfirst nil (ssget "_X" '((0 . "DIMENSION") (3 . "NAME DIMSTYLE HERE")))) ; SEARCH FOR DIMSTYLE BY NAME
Any ideas how to proceed?

Thanks

airportman

  • Newt
  • Posts: 37
  • i customize when required
Re: Stumped on this routine
« Reply #1 on: February 15, 2019, 01:51:07 PM »
when you update a dimstyle, save the drawing exit and re-open. it updates all dimensions affected.

or...

You can make a button to click:
^C^C-DIMSTYLE;_Apply
« Last Edit: February 15, 2019, 02:01:54 PM by airportman »
Perception is a state of mind  -/ Twitter = @hochanz -/ Intel i7 - 3.07GHz -/ 12GB Ram -/ Nvidia Quadro FX 1800

kpblc

  • Bull Frog
  • Posts: 396
Re: Stumped on this routine
« Reply #2 on: February 15, 2019, 01:53:20 PM »
Do you need to update dimstyle or change dimensions with this style?
You can use _.checkstandards to make it manually. Or you can use something like this:
Code - Auto/Visual Lisp: [Select]
  1. (defun tt (/ selset)
  2.   (if (setq selset (ssget "_X" '((0 . "DIMENSION") (3 . "NAME DIMSTYLE HERE"))))
  3.     (progn (foreach ent ((lambda (/ tab item)
  4.                            (repeat (setq tab  nil
  5.                                          item (sslength selset)
  6.                                          ) ;_ end of setq
  7.                              (setq tab (cons (ssname selset (setq item (1- item))) tab))
  8.                              ) ;_ end of repeat
  9.                            ) ;_ end of lambda
  10.                          )
  11.              (entmod (subst (entget ent) 3 (cons 3 "NewDimStyle")))
  12.              (entupd ent)
  13.              ) ;_ end of foreach
  14.            ) ;_ end of progn
  15.     ) ;_ end of if
  16.   ) ;_ end of defun
P.S. I didn't check this code. it's just an idea. Anyway, sssetfirst will never highlight entities not on current space.
Sorry for my English.