I am trying to create a macro or possibly a lispertine to draw a PLine then gather the area of the previously created PLine and then insert a block and insert the information into the block. I have gotten this done already but now I am trying to push this further. I am more curious to know if I can insert a field of a selected area into a block that way if I adjust the PLine it will automatically update. Here is the macro I have come up with (^C^CAREA;O;\attdia;0;_-insert;rname;\1;1;0;$M=$(rtos,$(/,$(getvar,AREA),144),2,0) "SQ FT";\\\attdia;1) that will let you select the already created PLine, insert the block and then insert the information into the block. But like I said I want the area to update automatically if the size changes.
Can anyone help me with this? Is this possible to take any further?
Solved! Go to Solution.
Lee Macs areas to field lisp can do this. If you change the polygons size a refresh will update the associated field.
Oh, I just typed it into Google and I figured out it is an external program. I am looking for a way to not have to rely on any external programs... Any other advice?
Ok, so basically there is a way but it is hard to do? I am not super good at Lispertine's so I guess I will have to go with using the external program.
I was only trying to do this solely in AutoCAD because I work for a big firm and if I could update everyone's autocad at the same that that would be best for me. Specially if something changes. I don't want to have to go to each persons computer and download this software.
Try my free AOL.lsp app on the Exchange:
It won't draw the PLINE but it'll Insert a Block with Attribute using a Field linking the Pline or Hatch Area.
I know, I have come across your app a few times. I am just really trying to hold out until I can confirm that I can not make this lispertine or macro, preferably a macro.
As ~Opie posted already, this can only be done with lisp and not a macro.
As for working in a big firm, just place the lisp file in a common location on the network.
Have everyone's AutoCAD Appload Startup Suite Contents point to the location where that lisp app. is saved
Then everytime AutoCAD starts, it'll load the lisp app automatically.
When the lisp app needs to be updated, just overwrite the file on the network location.
You are set to go.
So once again I really appreciate everyone input but I am really wanting to figure out this lisp to get the field in a dynamic block instead of having to run an external program. What I am trying to figure out is how the field command generates it's commands.
I have noticed that the object ID is the oly thing that changes...
These are two different codes I get from selecting certain closed PLines.
Area - 1
%<\AcObjProp Object(%<\_ObjId 8796087839344>%).Area \f "%pr0%lu2%ct4%qf1 SQ. FT.">%
Area – 2
%<\AcObjProp Object(%<\_ObjId 8796087838880>%).Area \f "%pr0%lu2%ct4%qf1 SQ. FT.">%
Opie -
Are you saying that I would have to create a new block every time I wanted to do this? I already have a designated block for this...
Actually I just read your response again and I think I understand what you are saying... I am going to try it right now.