Re: Lisp - Altering dimension properties



I thought you already had that problem licked with the code you posted.

"Brian W." <lovemy65stang@xxxxxxxxx> wrote in message
news:1166721518.627710.111660@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Precisely!

Michael Bulatovich wrote:
So it's only leaders that you don't want to change?

--


MichaelB
www.michaelbulatovich.ca

"Brian W." <lovemy65stang@xxxxxxxxx> wrote in message
news:1166711668.084111.39210@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I'm trying to change EVERY dimension in the drawing! They have a
variety of different dimstyles (scale, color, etc) with different sized
arrows and text in each individual drawing. There are close to 40
different style names used (ex. M1, M2, M3, DS1, DS2, DS3, 1, 2, 3,
etc) in each drawing. There are many different dim types (linear,
aligned, arc length, etc) in each drawing. Every dimension, no matter
the type, style, or scale should have the "Arrow1" and "Arrow2" values
changed from "Closed filled" to "Architectural tick". This should be
the only value that changes. The type, style, scale, color, etc. for
each individual dimension should remain unchanged. In every drawing I
open and run the code, every dimension in that opened drawing should
have the Arrows converted to Archticks as if you selected 1 dimension
in the drawing, changed the Arrow1 and Arrow2 values by hand, and
repeated this process until all dimensions in the drawing have been
changed.

Short answer, ALL of them!

Thanks,
Brian W.

Michael Bulatovich wrote:
Can you describe which dimensions you are trying to change and which
you
are
not?
--


MichaelB
www.michaelbulatovich.ca


"Brian W." <lovemy65stang@xxxxxxxxx> wrote in message
news:1166647131.645876.268080@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Each one of these drawings (and there are many thousands) have many
dimensions in them with a variety of different style names other
than
"Standard" (close to 40 different style names used for dimensions).
If
I was to limit my selection set to just one of them each time, my
code
would go on forever.
When I use this function:

(sssetfirst nil (ssget "_X" '((0 . "DIMENSION"))))
(princ)

All of the dimensions in a drawing are selected and put a set. From
there I can use the properties within AutoCad to change the Arrow1
and
Arrow2 properties. The scale, color, etc remains unchanged and the
ticks are the correct size for each individual dimension. Is there
a
way within lisp to change the Arrow1 and Arrow2 properties? Thanks
again for all the help and effort!

Brian W.

Michael Bulatovich wrote:
(setq ss (ssget "_X" '((0 . "DIMENSION"))))
(setq ss2(ssadd))
(setq counter (- (sslength ss) 1))
(while (>= counter 0)
(setq ent(entget(ssname ss counter)))
(if (member '(3 . "Standard") ent)
(ssadd (ssname ss counter) ss2))
(setq counter (1- counter))
)

This gives you a set named ss2 with all the dims in a drawing sith
the
style
"standard". Change the style name and apply your function to that
second
set.

--


MichaelB
www.michaelbulatovich.ca



"Brian W." <lovemy65stang@xxxxxxxxx> wrote in message
news:1166633883.904843.103380@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Michael, you are talking to a lisp amateur! I'm doing this as an
update to a much larger lisp program and this is just an add-on.
I
can
do basic stuff, like debugging and simple changes, but when it
comes
to
what your talking about, I'm lost!!! I guess what I need to be
asking
for is if there is anyone out there with code similar to the
pseudo-code I wrote, or how I would loop through every dimension
in
a
drawing? Again, thanks for all the help!

Brian W.

On Dec 20, 9:55 am, "Michael Bulatovich" <Ple...@xxxxxxxx> wrote:
If you really must go this route, you need to be more precise in
making
your
selection set. Sort for group codes related to linear dimensions
(
group
code 0 ) *and* the particular style you want to change (group
code
3).
You're getting pretty close...
--

MichaelBwww.michaelbulatovich.ca

"Brian W." <lovemy65st...@xxxxxxxxx> wrote in
messagenews:1166628737.160474.207470@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Here is the code I have right now:
(command "DIMBLK" "ARCHTICK" "DIMBLK1" "ARCHTICK" "DIMBLK2"
"ARCHTICK")
(sssetfirst nil (ssget "_X" '((0 . "DIMENSION"))))
(command "DIM" "UPDATE" "PREV" "" "EXIT")
This sets the dimstyle for archticks, selects all of the
dimensions,
and then updates them. The same problem still exists though,
in
that
if the existing dimensions have different scales, colors, etc.
they
are
all modified. I think what I really need to happen is the
following
pseudo-code:

-Create a list of every dimension in the drawing
-Create a list of every dimension in the drawing's dimstyle
-Loop for each dimension
-Set the dimstyle of the dimension to the current dimstyle
-Set the DIMBLK, DIMBLK1, and DIMBLK2 variables to "ARCHTICK"
-Update ONLY that one dimension
-End Loop

Is this even possible? Any help would be GREATLY
appreciated!!!

Thank You,
Brian W.

On Dec 19, 4:37 pm, "Michael Bulatovich" <Ple...@xxxxxxxx>
wrote:
"Brian W." <lovemy65st...@xxxxxxxxx> wrote in
messagenews:1166566967.382431.97760@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

I just tried this code:
(command "DIMBLK" "ARCHTICK" "DIM" "UPDATE" "ALL" ""
"EXIT")
It does the trick with one catch... It updates all of the
dimensions
(scale, colors, text height, etc.) to the current dimstyle,
AND
changes
the leaders to the current dimstyle. The problem is that
most
of
these
drawings have various dimstyles (scales, colors, text
heights,
etc.)
and THOSE dimstyles MUST stay the same, with the exception
of
the
DIMBLK1 and DIMBLK2. It also can not affect the
leaders.You
have
discovered the problem with your approach. I suggest one of
the
dimstyle approaches.
--

MichaelBwww.michaelbulatovich.ca






.