Object field question...
I do not know much about field but want to see what they can do for me.
I am trying to create a block that will have a field displaying the elevation of the block insertion.
I created a block with a point and an MTEXT where the MTEXT contains only an object field using the point.
The field expression is: %<\AcObjProp Object(%<\_ObjId 169129704>%).Coordinates \f "%lu2%pr2%pt4">%
I was hoping I would be able to have a block that would display the current elevation of the point but I only see 0.00 which is the elevation of the point in the block drawing and not the elevation based on the iinsertertion point of the insert.
If I use REFEDIT to edit the block the field shows the Z coordinate of the point as inserted.
I see the Object ID in the expression so now I am guessing this is the object id of the point in the block definition and does not update to the block insertion.
Does anyone know if there is a way to accomplish this?
Thanks
Comments
-
First set your units to the level of precision you require ( .0, .00, etc).
Then create a point to assign the field to ( the point will provide the Z value to the field. (Later, use UPDATEFIELD if/when you copy this point & it's field).
Next, enter MTEXT, right click, choose Insert Field.
In the Field dialogue, choose Objects ->Object,
Object type is Point,
Under Property, choose Postion
Under Format, choose Decimal
Uncheck the check boxes for X & Y, leaving Z checked,
and finallly pick the point you created earlier.
I have a screen capture showing the settings, but I don't see a way to post it here.
Hope that works for you. --Good luck!
0 -
I think you could acheive what you want by sticking the point and mtext together as a group rather than a block.
I have a wish for fields. I think in Autocad you can apply a scaling to the field value (for instance if you want to display a m2 area but is drawing in cm or mm units). This is not possible at the moment.
0 -
Thanks for the tips... The group idea is likely the best, I was hoping for a codeless solution but I will explore creating the field via lisp and then grouping.
I tried to define a group in the block and explode once inserted but the group did not persist. The field did update though ;-)
I have a lot to learn about fields!
0 -
Hi Greg,
Bricscad V11.4.1 has been released for download. The release notes tell us that support has been added for adding fields to attributes. Hope fully this will give the codeless option to provide the current elevation.
To use:
- Create a block with an attribute field.
- Insert the block.
- Edit the attribute and right click in the text field area and select "Insert Field".
- Browse to Object and select your block.
- Once selected pick on the "Position" property in the property list.
- In the format area select your units and uncheck the X and Y coordinate check boxes (leaving Z value checked).
- Pick Ok to place your field expression into the attribute.
You should see the Z returned in the attribute field. If you copy this block with its field setting to different Z coords about your drawing you should see that the Z value changes to reflect (may need to force a REGEN to see).
I guess Bricsys must of heard your request.
Regards,
Jason Bourhill
0 -
Jason, thanks for the info. I'll experiment with that.
0