Dynamic block: prevent update by regen; auto add + - based on UCS quadrant

Dynamic block: prevent update by regen; auto add + - based on UCS quadrant

Jooogyerek
Contributor Contributor
1,442 Views
6 Replies
Message 1 of 7

Dynamic block: prevent update by regen; auto add + - based on UCS quadrant

Jooogyerek
Contributor
Contributor

Hi for everyone.

I made a dynamic block which automatically measures and displays distance between the insertion point and the X axis after insertion or copy/paste.

I have two questions concerning it…
1.            How can I prevent the update of the block after a drawing regeneration? (Freezing the layer not working)
2.            Is there a way to force the attribute definition to display + - signs depending whether the insertion point is above or below of the axis?

I tried out some ideas… by direct and lateral approach also but the main problem is that the Diesel Expression field does not support insertion of additional field… At least it looks like.

0 Likes
1,443 Views
6 Replies
Replies (6)
Message 2 of 7

Jooogyerek
Contributor
Contributor

I wonder... are they stupid questions? Or just hard ones?

I can write down some detail about the progress ("non"-progress) if it may help...

0 Likes
Message 3 of 7

dmfrazier
Advisor
Advisor

I think your question is more hard than stupid. (1 is greater than 0, correct?)

 

One thing you might do to help others help you is to post a copy of your DB so we can touch it and feel it and see what it does (or doesn't).  (People who frequent this forum seem to be especially appreciative of the opportunity to interact with others' DBs.  Can you blame them?)

 

Also - describe, conceptually, what you are trying to accomplish with the block.  It may turn out that there is another, possibly simpler (therefore better, even if it is less fun) way to do what you are trying to do.

0 Likes
Message 4 of 7

Jooogyerek
Contributor
Contributor

    The basic idea is to create an elevation marker which measures and displays the elevation (distance in meters) from the project zero (from the current UCS’s X axis) in the Block’s Attribute Definition after the placement. It works like this:
In the Model I specify the section’s zero elevation as the origin of the new UCS’s X axis, then I Copy/Paste or Insert the elevation marker as many times I need, finally I put back the UCS (set the WCS).
    The current Default Value of the Attribute Definition consist of an Object/Formula Field (let’s call it A) which consist of another two fields.:
The first one is Object/Block Placeholder/Position Field (let’s call it Insertion point) which displays the distance between the Reference Point of the Block and the X axis of the WCS in millimeters.
The second one is Other/SystemVariable/UCSORG Field (let’s call it UCSORG) which displays the distance between the X axis of the current UCS and the X axis of the WCS in millimeters too.

The whole Formula of the Field A looks like this:
ROUND((InsertionPoint-UCSORG)/5)*5/1000

Then the whole Field Expression is this:
%<\AcExpr (ROUND((%<\AcObjProp.16.2 Object(?BlockRefId,1).InsertionPoint \f "%lu2%pt2%pr3">% -%<\AcVar ucsorg \f "%lu2%pt2%ds44">%)/5)*5/1000) \f "%lu2%pr3%ds44">%

    The first flaw is that after the Regeneration of the drawling the results are recalculated based on the current UCS or WCS. By BURSTing the Markers after the placement or by placing the whole section to the X axis of the WCS the problem is solved but I hope that it can be done more… elegantly.
    The second flaw is that the measurements are displayed without the - + ± signs in front (except the -).
    The basic idea is to Insert another Field (to the front of the Absolute Value of Field A) which will displays the correct “prefix” based on whatever the elevation is negative, positive or zero.
   Based on my experiences with MS Excel it could be done by an “IF-THEN” kind of function so I searched for a Field with similar functionality.
    As far as I know the only Field capable doing this is Other/DieselExpression Field but two Fields and a ABS() Formula have to be added. For this a simpler version of the basic A Field would be used, just the subtraction of the InsertionPoint and UCSORG Fields without rounding it off and dividing by a thousand (let’s call it B).

The whole Field Expression of the B Field is this:
%<\AcExpr (%<\AcObjProp.16.2 Object(?BlockRefId,1).InsertionPoint \f "%lu2%pt2%pr3">%-%<\AcVar ucsorg \f "%lu2%pt2%ds44">%) \f "%lu2%pr3%ds44">%

The DieselExpression Schematically should look like this.:

$(IF,B,$(IF,$(+,ABS(B),-B),-,+),%%P)

    Basically it means: IF B is even to zero, THEN display ±, OTHERWISE, IF Absolute Value of B minus B is even to zero, THEN display +, OTHERWISE display -.
    To make it work, the ABS() Formula have to be added as a Field Expression.:

$(IF,B,$(IF,$(+,%<\AcExpr (ABS(B))>%,-B),-,+),%%P)

And the B Fields as well.:

$(IF,%<\AcExpr (%<\AcObjProp.16.2 Object(?BlockRefId,1).InsertionPoint \f "%lu2%pt2%pr3">%-%<\AcVar ucsorg \f "%lu2%pt2%ds44">%) \f "%lu2%pr3%ds44">%,$(IF,$(+,%<\AcExpr (ABS(%<\AcExpr (%<\AcObjProp.16.2 Object(?BlockRefId,1).InsertionPoint \f "%lu2%pt2%pr3">%-%<\AcVar ucsorg \f "%lu2%pt2%ds44">%) \f "%lu2%pr3%ds44">%))>%,-%<\AcExpr (%<\AcObjProp.16.2 Object(?BlockRefId,1).InsertionPoint \f "%lu2%pt2%pr3">%-%<\AcVar ucsorg \f "%lu2%pt2%ds44">%) \f "%lu2%pr3%ds44">%),-,+),%%P)

It works… if I use just numbers in the DieselExpression Field (0’s result is ±; 1’s result is +; -1’s result is -) Displays the correct signs instantly after closing the Diesel Expression Field, but when I use the Formula’s Field Expression and I reenter it, the inner Fields are simplified to the actual results of the Fields. It turns them to invariants.
    I also tried out an AutoCAD add-on called AutoField because it also has additional IF function but neither supports adding inner Fields and Formulas. And there is the point where I am stuck.

0 Likes
Message 5 of 7

ojuris
Advisor
Advisor

hi!

 

My concept for this problem is little bit different. I made set of two different blocks 1. is elevation marker, 2. is "zero place marker".

 

I copy set in drawing, place "zero place marker" on the 0 place and after this copy elevation marker where I need.

 

When I need elevation marks from different 0 level, I again copy set of 2 blocks to different lacation, place "zero place marker" on the new 0 place and after this copy elevation marker where I need.

 

 

About + and - problem in reality I have 4 blocks in set - "zero place marker" and 3 elevation marker blocks or sometimes I just write + or +- signs when I need it

0 Likes
Message 6 of 7

Jooogyerek
Contributor
Contributor

Well… ok. From the beginning of this topic after all these years I use the same approaches just as you suggested. But still they are just workarounds not solutions. But thanks anyway.

 

Does Autodesk have a platform for suggested/needed changes/features? (Like a wish list)

 

By the way, happy New Year everybody!

0 Likes
Message 7 of 7

charlie.lyth
Participant
Participant

part of my housing development project involves putting points down at each corner of a house and inputting the original ground level, proposed ground level and the minimum depth required by standards based on the original and proposed levels. The block then calculates the minimum required founding level at each point (IFL) and the depths from the OGL and EGL. So that is 4 values, + two secondary block-plot identifiers for using during exporting this info into excel. The way the formulas are currently set up, I need to make 3 consecutive saves in order to update each field. Attsync overrides the formulas, and I'm currently working on a file with 1428 of these blocks, so you may imagine the save time takes bloody years, nevermind doing it 3 times in a row. I would be really interested to see if there is a way of just updating the blocks and speed up the process slightly.

Thanks

0 Likes