Results 1 to 8 of 8

Thread: Formulas For Fields

  1. #1
    Member
    Join Date
    2014-08
    Posts
    4
    Login to Give a bone
    0

    Default Formulas For Fields

    Hi All,
    Not sure this is the place to put this but here it goes.

    I am working with mtext and would like to have it automatically grab either the x,y,or z position of the insertion point. I would like this to be a field that updates if it moves.

    I was playing around with fields and the only way I could find out how to do it was to create an object (a point) and then have the field look at the position of the object.

    I have these questions:
    Is there a way to make it look at itself for the axis?
    Is there a way to create a formula (under the Objects category) so it grabs the axis?

    Thanks in advance for any help.

    Dave

  2. #2
    Mod / Salary / SM Wanderer's Avatar
    Join Date
    2001-12
    Location
    St. Louis
    Posts
    5,408
    Login to Give a bone
    0

    Default Re: Formulas For Fields

    Quote Originally Posted by DavidMacomber View Post
    Hi All,
    Not sure this is the place to put this but here it goes.

    I am working with mtext and would like to have it automatically grab either the x,y,or z position of the insertion point. I would like this to be a field that updates if it moves.

    I was playing around with fields and the only way I could find out how to do it was to create an object (a point) and then have the field look at the position of the object.

    I have these questions:
    Is there a way to make it look at itself for the axis?
    Is there a way to create a formula (under the Objects category) so it grabs the axis?

    Thanks in advance for any help.

    Dave
    Hi, Dave! Congrats on making your first post! We love field so much, we gave them their own subforum. So, I have moved your question from the CAD Management form to the AutoCAD - Fields forum for you, as you should get your best audience here.

    Cheers!
    Melanie Stone
    @MistresDorkness

    Archibus, FMS/FMInteract and AutoCAD Expert (I use BricsCAD, Revit, Tandem, and Planon, too)
    Technical Editor
    not all those who wander are lost

  3. #3
    Certifiable AUGI Addict
    Join Date
    2001-03
    Location
    Tallahassee, FL USA
    Posts
    3,667
    Login to Give a bone
    0

    Default Re: Formulas For Fields

    Are you wanting to label the x,y,or z position of the Mtext or of another object?

    Here's a simple example using a block:
    Code:
    ;| Label for Point.
       PtLabel.lsp BY: TOM BEAUFORD
       ^P(or C:Label (load "PtLabel.lsp"));PtLabel
       BeaufordT@LeonCountyFL.gov
       Leon County Public Works/Engineering
    ==================================================================|;
    
    (defun C:PtLabel (/ ATTDIA)
          (setq ATTDIA (getvar "ATTDIA"))
          (setvar "ATTDIA" 0)
          (command "._INSERT"
                   "Pt_Coordinates"
                   (getpoint "Pick Point: ")						;Insert pt
                   (/ 0.1 (getvar "cannoscalevalue"))				;X Scale
    ;               (* (getvar "DIMTXT") (getvar "DIMSCALE"))	;X Scale (Alternate)
                   ""							;Y Scale
    ;               ""				                	;Rotation
                   (*(/(getvar "viewtwist")pi)-180)	;Rotation
                   ""					        	;Easting
                   ""					        	;Northing
          )
          (setvar "ATTDIA" ATTDIA)
          (entupd (entlast))
    ;      (command "._DDATTE" (entlast))
          (princ)
    )
    Attached Files Attached Files

  4. #4
    Member
    Join Date
    2014-08
    Posts
    4
    Login to Give a bone
    0

    Default Re: Formulas For Fields

    I am wanting the MText to label itself. If i move the Mtext to an elevation on any one of the axes then the Mtext will change as i move it.

    Not real sure how to explain it but the MText would grab the x,y,or z of itself.
    I know you can make it grab the info off of a point or other object but not sure if you can make it reference its own information.

  5. #5
    Certifiable AUGI Addict
    Join Date
    2001-03
    Location
    Tallahassee, FL USA
    Posts
    3,667
    Login to Give a bone
    0

    Default Re: Formulas For Fields

    Quote Originally Posted by DavidMacomber View Post
    I am wanting the MText to label itself. If i move the Mtext to an elevation on any one of the axes then the Mtext will change as i move it.

    Not real sure how to explain it but the MText would grab the x,y,or z of itself.
    I know you can make it grab the info off of a point or other object but not sure if you can make it reference its own information.
    You would probably need to create the MText first so there would be an object for the field to get properties. Then replace the text with the field.

  6. #6
    Certified AUGI Addict cadtag's Avatar
    Join Date
    2000-12
    Location
    Cairo - no, not Illinois
    Posts
    5,069
    Login to Give a bone
    0

    Default Re: Formulas For Fields

    Option B, create a point as the thing to locate, then GROUP it to the Field.

  7. #7
    Administrator Opie's Avatar
    Join Date
    2002-01
    Location
    jUSt Here (a lot)
    Posts
    9,106
    Login to Give a bone
    0

    Default Re: Formulas For Fields

    Quote Originally Posted by cadtag View Post
    Option B, create a point as the thing to locate, then GROUP it to the Field.
    Or make it a block and change from MText to an Attribute. Within the block editor, the attribute can have a block place holder field which allows it to reference the block's data once inserted.
    If you have a technical question, please find the appropriate forum and ask it there.
    You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
    jUSt

  8. #8
    Member
    Join Date
    2014-08
    Posts
    4
    Login to Give a bone
    0

    Default Re: Formulas For Fields

    Quote Originally Posted by Opie View Post
    Or make it a block and change from MText to an Attribute. Within the block editor, the attribute can have a block place holder field which allows it to reference the block's data once inserted.
    I went with the block with a place holder in it to reference the attribute to.

    Thanks for the help

Similar Threads

  1. Formulas
    By mwenta in forum Revit Architecture - Families
    Replies: 96
    Last Post: 2010-06-25, 06:41 PM
  2. on/off formulas
    By SRobbins1977 in forum Revit Architecture - Families
    Replies: 8
    Last Post: 2009-04-15, 09:14 PM
  3. Match line call outs as fields - link fields across sheets
    By david_ellis in forum AutoCAD Fields
    Replies: 1
    Last Post: 2006-06-13, 09:49 PM
  4. Excel Formulas in Fields
    By red2002yzfr1 in forum AutoCAD Fields
    Replies: 2
    Last Post: 2005-07-28, 06:21 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •