Match format properties of a data field (attribute block)

Match format properties of a data field (attribute block)

AutoBIx
Contributor Contributor
491 Views
5 Replies
Message 1 of 6

Match format properties of a data field (attribute block)

AutoBIx
Contributor
Contributor

Acad 2022 on Windows 10
I've a block with attributes, one of these is a data field (AREA) picked from a closed polyline.
every time i insert/copy the block and i pick a new polyline i need to reassign the format properties of the data field
- 0.00 decimals
- Converting factor 0.0001
- Suffix (m²)
Is there a way to have a "matchprop" like command that copy that format properties from a block to many other that have the same field?

Thanks a lot.
Bix

0 Likes
492 Views
5 Replies
Replies (5)
Message 2 of 6

Sea-Haven
Mentor
Mentor

The issue is that a field has a ID property. You can though do a lisp so that you pick say a pline then insert the block with the attribute with correct ID. 

 

%<\AcObjProp.16.2 Object(%<\_ObjId 1677683632>%).Area \f "%zs8">%

 

So can PUT where the textstring is as above, the ID being returned from selecting an object and getting its ID

(Vla-put-textstring att str) 

 

(setq id (vla-get-ObjectId (vlax-ename->vla-object (car (entsel "\n Select pline: ")))))

 

 

 

Do you know how to lisp ?

 

 

 

 

0 Likes
Message 3 of 6

AutoBIx
Contributor
Contributor
Nope... any experience... -.-'
0 Likes
Message 4 of 6

paullimapa
Mentor
Mentor

Give my free AOL App a try which should help with setting the area value format you want and assist in selecting a Pline to link to an Attribute 

https://apps.autodesk.com/ACD/en/Detail/Index?id=2758261577526102910&appLang=en&os=Win32_64


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 5 of 6

AutoBIx
Contributor
Contributor

Very interesting but i can not install applications on this work machine... do you have also the LSP version?

0 Likes
Message 6 of 6

paullimapa
Mentor
Mentor

yes...the current version on AOL App found on the App Store actually only uses a single lisp file, though the next version will have multiple lisp files. So I've attached AOL.LSP here for you to download. The other files you won't have just prevents you from accessing the App on the Ribbon panel. But AOL should still run properly if you follow these instructions:

1. Save AOL.LSP in a folder where you store all your other LISP files. 

2. In AutoCAD run OPTIONS > File > Support File Search Path and add that folder 

3. Open the drawing you want to create the link between Text/MText/Attribute & Pline's area

4. Drag & drop AOL.LSP from that folder onto the graphics screen (or APPLOAD and select AOL.LSP from the folder to load)

5. When prompted with Security - Unsigned Executable File click Always Load

6. Once loaded successfully the command prompt will show the two new commands added: AOL & AOLSET

7. To launch AOL App enter at the command prompt: AOL

The first time you run AOL App the gui will appear for you to select command options & area value formatting.

Once you click OK, the next time you enter AOL the App will launch without the gui and will run using your previous selected commands & format settings.  Enter AOLSET at the command prompt to access the gui again.

Let me now if you run into any issues using AOL App

paulli_apa_0-1670426524992.png

 

 

 


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes