Jump to content

Mtext field in a block


Grigs

Recommended Posts

I would like to create a block that gets the square footage of a closed polyline. I believe you use a mtext field. Does anyone have a block like this?

Link to comment
Share on other sites

Type FIELD at the command line, choose Object, select your Polyline and you will see the Area property.

 

Else, I wrote a LISP for this a while back:

http://www.cadtutor.net/forum/showthread.php?t=46420

Link to comment
Share on other sites

is there anyway to link a polyline to a block that has the field in it afterwards? Like have a block made, draw a polyline, insert the block and assign that block to a specific polygon?

Link to comment
Share on other sites

In the MText, Text or Attribute editor, you can insert a Field that references any type of object (just right-click in the editor). It's just up to you what values you want extracted.

Link to comment
Share on other sites

Yes, you can copy/paste the Field code into the attribute, or use the LISP I linked you to.

Teach to fish first.

 

field.PNG

Link to comment
Share on other sites

Of course, just offering all options :D

I know, but you're a little to quick on the draw to give them a program to do it for them.:wink:

 

In all fairness, the thread is in the Lisp section.

Link to comment
Share on other sites

Thanks. I was able to create a field that extracted the area from a closed polyline. My issue is that I want to create a block that contains the object|area field, but my confusion is linking it to an editable polyline. If you include the polyline in the block, you can't change the size.

Link to comment
Share on other sites

Perhaps use an attributed block and copy/paste the relevant field code into that attribute. Else I'm not sure if Dynamic blocks have that capability...

Link to comment
Share on other sites

Ok!! The light came on!! I created an attrubuted block that had the field in it. I then inserted it into a drawing a drew a closed polyline. When I went into the eattedit command, I double-clicked on the 'value' and it allowed me to pick a specific polyline.

 

 

 

Thanks

Link to comment
Share on other sites

Been accused of doing things bass-ackwards before :()

Unless I read your procedure incorrectly, without the aid of code, I would have done it the same way.

Link to comment
Share on other sites

Unless I read your procedure incorrectly, without the aid of code, I would have done it the same way.

 

I would have inserted the block, then copied the field code into the attribute - perhaps I'm the backwards one o:)

Link to comment
Share on other sites

I would have inserted the block, then copied the field code into the attribute - perhaps I'm the backwards one o:)

If the the attributed block was specific to that purpose, I would, when creating the block, go ahead and field reference a PLine. When I insert the block, the default value will be nil, but when I edit the attribute and edit the field, it will jump straight to the PLine area field and all I have to do is select a new PLine. Just saves a few steps.

I did the same thing in our titleblock for the viewport scale.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...