Annotation Block with Dynamic Area Field with Multipliers

Annotation Block with Dynamic Area Field with Multipliers

Crass
Collaborator Collaborator
282 Views
3 Replies
Message 1 of 4

Annotation Block with Dynamic Area Field with Multipliers

Crass
Collaborator
Collaborator

Hello! I posted this message in the Dynamic Blocks Forum, but it was suggested that I move it over here. The issue is that I don't know how to work with LISP other than using ones created by others, which I do regularly, so this may end up being over my head, but I figure it's still worth getting some insight from the group.

 

I want to create a tool where I can click on a hatch or closed polyline and then a block would be generated that can be inserted wherever you want by the user. The block would contain the area (SqFt in this case) of the hatch. It would be dynamic and associated with that hatch so that when the shape changes the area in the block would also update. In addition, I'd like to create a multiplier (formula) accessible through a dropdown in the block which would give a different value based on a formula using the multiplier and hatch area. The goal is to rapidly determine plant unit quantities based on area of planting bed x spacing of plants using the formula and have that all visible and dynamic in the annotation block.

 

Does anyone have any suggestions on how to start with this project? Maybe there is already a block or LSP out there that already comes close to this that I can modify?  Thank you!

-----
AutoCAD 2018/2021
AutoCAD Civil 3D 2021
0 Likes
283 Views
3 Replies
Replies (3)
Message 2 of 4

paullimapa
Mentor
Mentor

Try my AOL. It doesn’t have a formula option and is not annotative but could be a good start

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
Message 3 of 4

Crass
Collaborator
Collaborator

@paullimapa - This is a great tool! Very impressive. I think you are right. This is a great starting point. Editing this is definitely above my skill level but I may try to research how to do in my "free time." Adding another Attdef with formula and multiplier to this is exactly what I want!

-----
AutoCAD 2018/2021
AutoCAD Civil 3D 2021
0 Likes
Message 4 of 4

paullimapa
Mentor
Mentor

Here's another simpler code ZoneTag.lsp I started to modify from another post.

Included is a Block with Attribute creation function MkDyBlAt which includes built-in annotative features for both: Text Style (used by Attribute Definitions) and Block (thanks to Lee Mac). 

Also the area string composed with Field code includes the conversion factor for square feet:

        (setq AreaString
         (strcat 
          "%<\\AcObjProp.16.2 Object (%<\\_ObjId " 
          (Get-ObjectIDx64 (vlax-ename->vla-object en)) 
          ">%).Area \\f \"%lu2%pr2%ps[, Ft" 
          (chr 178) 
          "]%ct8[0.0069444444444444]%th44\">%"
         )
        )

compared to when there's no conversion factor for square inch:

        (setq AreaString
         (strcat 
          "%<\\AcObjProp.16.2 Object (%<\\_ObjId " 
          (Get-ObjectIDx64 (vlax-ename->vla-object en)) 
          ">%).Area \\f \"%lu2%pr2%ps[, Inch" 
          (chr 178) 
          "]%th44\">%"
         )
        )

Perhaps you can modify this factor to include your formula.

paullimapa_0-1689612066174.png

 


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