See the top rated post in this thread. Click here

Page 1 of 3 123 LastLast
Results 1 to 10 of 26

Thread: Block Name in a field

  1. #1
    Member
    Join Date
    2015-08
    Posts
    18
    Login to Give a bone
    0

    Default Block Name in a field

    Hello,

    I'm looking for some help. I'm trying to have a block's name show up as text within the block itself without using attributes. I am wanting to edit the block using refedit not bedit - that's why no attributes. I can get it to work using block place holders in an attribute, but this makes it so that I have to edit the block's geometry using bedit. Which is very inconvenient.

    Thanks for the help!

  2. #2
    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: Block Name in a field

    uhm,,, confused. if you want the block name to be displayed in the block, why not just use a piece of text as part of the block?

  3. #3
    Member
    Join Date
    2015-08
    Posts
    18
    Login to Give a bone
    0

    Default Re: Block Name in a field

    I'm hoping to copy the block, do a copy/rename (Lee Mac program) on the block and have the new block show the new name.

  4. #4
    All AUGI, all the time
    Join Date
    2016-02
    Location
    Sydney, Australia
    Posts
    512
    Login to Give a bone
    0

    Default Re: Block Name in a field

    A diesel string should give the "filename", but i'm not sure what the block name system variable is.

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

    Default Re: Block Name in a field

    Best thing would be to add a field after the block is inserted.
    Field category: Objects
    Field names: Object
    Use the select button for Object type:
    Property: Name
    Click [OK] then place block label.

  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: Block Name in a field

    I don't believe there's any way a field can do that -- fields are essentially dynamic in nature and you want something that will remain static (until you re-run the LISP routine).

    I'd suggest that you modify the LISP code to change the value of a text string that's part of the block to display the new name you are giving the new block definition.

    It will still be prone to breakage -- what should hapopen if someone uses the RENAME command after the new block definition is made via LISP?

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

    Default Re: Block Name in a field

    Quote Originally Posted by cadtag View Post
    I don't believe there's any way a field can do that -- fields are essentially dynamic in nature and you want something that will remain static (until you re-run the LISP routine).

    I'd suggest that you modify the LISP code to change the value of a text string that's part of the block to display the new name you are giving the new block definition.

    It will still be prone to breakage -- what should hapopen if someone uses the RENAME command after the new block definition is made via LISP?
    Tested it using Lee Mac's CopyRenameBlockV1-5.lsp.
    A regen after renaming the block updated the field and displayed the new block name. Works with rename command as well.

  8. #8
    Administrator BlackBox's Avatar
    Join Date
    2009-11
    Posts
    5,719
    Login to Give a bone
    0

    Default Re: Block Name in a field

    Quote Originally Posted by cadtag View Post
    I don't believe there's any way a field can do that -- fields are essentially dynamic in nature and you want something that will remain static (until you re-run the LISP routine).

    I'd suggest that you modify the LISP code to change the value of a text string that's part of the block to display the new name you are giving the new block definition.

    It will still be prone to breakage -- what should hapopen if someone uses the RENAME command after the new block definition is made via LISP?
    Object-specific Fields simply reference an ObjectId, which ultimately is a simple string substitution within the resultant (copied) Field, in order to reference the ObjectId of the resultant Object being referenced in same.

    Code:
    (vl-load-com)
    
    (defun c:GetFieldCode (/ x)
      (if
        (and
          (setq x (ssget ":S:E"))
          (setq x (vlax-ename->vla-object (ssname x 0)))
          (vlax-method-applicable-p x 'fieldcode)
        )
         (prompt (strcat "\nFieldCode: " (vla-fieldcode x)))
         (prompt "\n** Invalid selection ** ")
      )
      (princ)
    )
    
    (defun c:GetObjectId (/ x)
      (if
        (and
          (setq x (ssget ":S:E"))
          (setq x (vlax-ename->vla-object (ssname x 0)))
        )
         (prompt (strcat "\nObjectId: " (itoa (vla-get-objectid x))))
      )
      (princ)
    )
    "How we think determines what we do, and what we do determines what we get."

    Sincpac C3D ~ Autodesk Exchange Apps

    Computer Specs:
    Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000

  9. #9
    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: Block Name in a field

    I may well be misunderstanding. Having a filed in a DWG that displays the name of a placed block I understand. But, I didn't thank that was what the OP wanted. Can someone post an example of a block containing a field in its defintion that has the name of the block displayed?

    Since the block won't exist when the field is placed, how is it populated?

  10. #10
    Administrator BlackBox's Avatar
    Join Date
    2009-11
    Posts
    5,719
    Login to Give a bone
    0

    Default Re: Block Name in a field

    Now we're getting into circular references, which is not what I was commenting on - for that see this apt post.
    "How we think determines what we do, and what we do determines what we get."

    Sincpac C3D ~ Autodesk Exchange Apps

    Computer Specs:
    Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000

Page 1 of 3 123 LastLast

Similar Threads

  1. 2015: A way to have Field and Block Linked?
    By mary.waligora696733 in forum Dynamic Blocks - Technical
    Replies: 3
    Last Post: 2015-04-13, 05:42 PM
  2. Block with field attributes within a dynamic block conundrum
    By flash5238 in forum Dynamic Blocks - Technical
    Replies: 0
    Last Post: 2014-05-13, 07:51 PM
  3. Replies: 0
    Last Post: 2013-10-31, 08:42 PM
  4. Field in Dyn Block
    By bshank.140587 in forum Dynamic Blocks - Technical
    Replies: 6
    Last Post: 2010-08-06, 08:31 PM

Tags for this Thread

Posting Permissions

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