Results 1 to 2 of 2

Thread: Update the width factor of text in a block

  1. #1
    Member
    Join Date
    2014-10
    Posts
    14
    Login to Give a bone
    0

    Default Update the width factor of text in a block

    Hello Everyone –

    I am looking for some help to create a lisp program to update the width factor of text and/or possibly mtext inside a block. Text update is the main thing I'm looking for...

    I use the code below to select all blocks in a drawing and then update the width factor of all attributes inside the selected blocks. This code works great. I have not found a ‘vla-get’ command to work with text (code highlighted in blue).

    Sample Code:

    (if (setq ss1 (ssget "x" '((0 . "INSERT") (66 . 1))))
    (prong
    (setq a1 0)
    (repeat (sslength ss1)
    (setq obj1 (vlax-ename->vla-object (ssname ss1 a1)))
    (foreach item
    (vlax-safearray->list (vlax-variant-value
    (vla-getattributes obj1)))
    (vla-put-scalefactor item 1.0)
    )
    (setq a1 (1+ a1))
    )
    )
    )


    Thank you in advanced for your help with this.

  2. #2
    All AUGI, all the time
    Join Date
    2003-07
    Posts
    560
    Login to Give a bone
    0

    Default Re: Update the width factor of text in a block

    The method you posted is one block at a time, rather than changing the actual "Block" entities which will change all blocks of that name. Just search for changing block properties it will use the method of getting a block from the block table which holds all blocks details. You can see below that the block I looked for has 21 items you now need to go into those items and dig a bit deeper.

    https://forums.autodesk.com/t5/visua...s/td-p/7040108

    Code:
    (vlax-for blks (vla-get-blocks doc)
    (if (= (vla-get-name blks) "DA1DRTXT")
    (VLAX-DUMP-OBJECT BLKS)
    )
    )
    Code:
    ; IAcadBlock: A block definition containing a name and a set of objects
    ; Property values:
    ;   Application (RO) = #<VLA-OBJECT IAcadApplication 00007ff746cb51a8>
    ;   BlockScaling = 0
    ;   Comments = ""
    ;   Count (RO) = 21
    ;   Document (RO) = #<VLA-OBJECT IAcadDocument 000001f3a61b2408>
    ;   Explodable = -1
    ;   Handle (RO) = "A15F"
    ;   HasExtensionDictionary (RO) = -1
    ;   IsDynamicBlock (RO) = 0
    ;   IsLayout (RO) = 0
    ;   IsXRef (RO) = 0
    ;   Layout (RO) = AutoCAD.Application: The property is not available in current state
    ;   Name = "DA1DRTXT"
    ;   ObjectID (RO) = 42
    ;   ObjectName (RO) = "AcDbBlockTableRecord"
    ;   Origin = (0.0 0.0 0.0)
    ;   OwnerID (RO) = 43
    ;   Path = AutoCAD.Application: Not applicable
    ;   Units = 0
    Last edited by BIG-AL; 2018-06-04 at 06:42 AM.

Similar Threads

  1. Replies: 1
    Last Post: 2016-08-10, 11:59 AM
  2. dynamic text width factor?
    By randyspear in forum Dynamic Blocks - Technical
    Replies: 1
    Last Post: 2009-08-21, 11:09 PM
  3. Dim text Width Factor
    By jmartinek in forum Revit Architecture - General
    Replies: 8
    Last Post: 2008-01-11, 01:56 PM
  4. width factor for dim text
    By bjohns in forum Revit Architecture - General
    Replies: 4
    Last Post: 2007-10-04, 02:39 AM
  5. Dimension text width factor
    By barathd in forum Revit Architecture - Wish List
    Replies: 3
    Last Post: 2006-06-07, 01:10 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
  •