Performance issue while update attribute values in dynamic block

Performance issue while update attribute values in dynamic block

PanzerRanger
Enthusiast Enthusiast
1,268 Views
6 Replies
Message 1 of 7

Performance issue while update attribute values in dynamic block

PanzerRanger
Enthusiast
Enthusiast

Hi! Im fairly new to programing in Autocad and in my current employment Im at lokced down to using Autocad LT

 

Issue:
I need to autoincrese numbers when inserting block, its ment to be used designing firealarmsystems. I got the Diesel variable to work:

^c^c-insert;"SBF - Rökdetektor";\1;;\setvar;useri1;$M=$(if,$(=,$(getvar,USERI1),9),0,$(+,1,$(getvar,USERI1)));setvar;useri2;$M=$(if,$(=,$(getvar,USERI1),9),$(if,$(=,$(getvar,USERI2),9),0,$(+,1,$(getvar,USERI2))),$(getvar,USERI2))

The only thing I got working when trying to get the attribute right, is using fileds 
%<\AcVar Useri2 >%%<\AcVar Useri1 >%

 

The problem is that regen  blows that option out of the water and any suggestions to solve this as Im stuck.

 

 

0 Likes
Accepted solutions (1)
1,269 Views
6 Replies
Replies (6)
Message 2 of 7

pbejse
Mentor
Mentor
Try to include UPDATEFIELD on your macro
0 Likes
Message 3 of 7

PanzerRanger
Enthusiast
Enthusiast

How do I use it in the macro to black the fields from being updated?

0 Likes
Message 4 of 7

pbejse
Mentor
Mentor

@PanzerRanger wrote:

How do I use it in the macro to black the fields from being updated?


I think I misunderstood the request PanzerRanger, How's about setting FIELDVAL  value to 0?

It's an interesting challenge to increment attribute values without lisp,

 

I would approach this the same way using USERi* variable, I will dig in deeper and see what i come up with.

0 Likes
Message 5 of 7

cadffm
Consultant
Consultant
Accepted solution
Remove the field from attdef and fill the value by insert command and diesel-expression.

Set Attreq=1,Attdia=0

Set Useri1&2

Insert your Block

Fill your attribute with current value of useri1&2

I am on the way, so shortened only in bullet points.

^C^C

setvar;useri1;$M=$(if,$(=,$(getvar,USERI1),9),0,$(+,1,$(getvar,USERI1)));setvar;useri2;$M=$(if,$(=,$(getvar,USERI1),9),$(if,$(=,$(getvar,USERI2),9),0,$(+,1,$(getvar,USERI2))),$(getvar,USERI2))

insert;sampleblock;\1;1;0;$M=$(getvar,USERI1)$M=$(getvar,USER2)

In this kind you have a normal stupid attributvalue..

Sebastian

Message 6 of 7

PanzerRanger
Enthusiast
Enthusiast
I'll give that ago later today or tomorrow. I tried it doing it before I hope your option works cause that would solve lots of my problems
0 Likes
Message 7 of 7

PanzerRanger
Enthusiast
Enthusiast

Cheers man that worked like a charm!

0 Likes