+ Reply to Thread
Results 1 to 5 of 5
  1. #1
    Super Member Bill Tillman's Avatar
    Using
    AutoCAD 2014
    Join Date
    Oct 2008
    Location
    Miami, FL
    Posts
    1,068

    Default Change Dimension Text pos vert

    Registered forum members do not see this ad.

    A few months ago after much hair pulling and some advice here and there I came up with this nice snippet which changes the TextOverride for a dimension that is the (entlast).

    Code:
    (vlax-put-property (vlax-ename->vla-Object (handent (cdr (assoc 5 (entget (entlast))))))
        "TextOverride" "<>\\PFRAME OPENING")
    Today I was asked if we could rotate the dimension 90° counterclockwise so I tried this:

    Code:
    (vlax-put-property (vlax-ename->vla-Object (handent (cdr (assoc 5 (entget (entlast))))))
        "Rotation" (dtr -90.0))
    and bingo, it worked like Lee-Mac or Fixo had written it themselves for me. The request also came to adjust the Text vert pos to "Above" instead of "Centered". So I thought cool, I'll just try it like this:

    Code:
    (vlax-put-property (vlax-ename->vla-Object (handent (cdr (assoc 5 (entget (entlast))))))
        "Textposvert" "Above")
    but no such luck. I end up with:

    Error: ActiveX Server returned the error: unknown name: Textposvert

    I tried all kinds of variations for Textposvert, (Text Pos Vert, posvert, pervert....) anything to see what might work. But so far nothing is working. I was hoping this would be just as straight forward as the first solution.

    This is for my totally automated process...no user input is allowed, only code for a solution. Any suggestions would be appreciated.
    It's deja vu, all over again.

  2. #2
    Quantum Mechanic Lee Mac's Avatar
    Computer Details
    Lee Mac's Computer Details
    Operating System:
    Windows 7 Ultimate (32-bit)
    Discipline
    Multi-disciplinary
    Lee Mac's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Custom Programming / Software Customisation
    Using
    AutoCAD 2013
    Join Date
    Aug 2008
    Location
    London, England
    Posts
    16,879

    Default

    Bill,

    Aside from your question, have a think about what this expression is doing:

    Code:
    (handent (cdr (assoc 5 (entget (entlast)))))
    Lee Mac ProgrammingTwitterExchange App StoreDropbox (500MB free)

    With Mathematics there is the possibility of perfect rigour, so why settle for less?

  3. #3
    Quantum Mechanic Lee Mac's Avatar
    Computer Details
    Lee Mac's Computer Details
    Operating System:
    Windows 7 Ultimate (32-bit)
    Discipline
    Multi-disciplinary
    Lee Mac's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Custom Programming / Software Customisation
    Using
    AutoCAD 2013
    Join Date
    Aug 2008
    Location
    London, England
    Posts
    16,879

    Default

    You receive the error because a Dimension object does not have the property 'textposvert'. If you are planning on just guessing the names of properties that VLA-Objects possess, then prepare for a long time spent pulling your hair out...

    Instead, consider using the vlax-dump-object function in conjunction with the ActiveX & VBA Reference as part of the Visual LISP IDE Help Docs.

    After a quick check with the above function, I can see that the property you require is the TextGap property. However, note that this will be applied as a Dimension Style Override!
    Lee Mac ProgrammingTwitterExchange App StoreDropbox (500MB free)

    With Mathematics there is the possibility of perfect rigour, so why settle for less?

  4. #4
    Quantum Mechanic Lee Mac's Avatar
    Computer Details
    Lee Mac's Computer Details
    Operating System:
    Windows 7 Ultimate (32-bit)
    Discipline
    Multi-disciplinary
    Lee Mac's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Custom Programming / Software Customisation
    Using
    AutoCAD 2013
    Join Date
    Aug 2008
    Location
    London, England
    Posts
    16,879

    Default

    Did you resolve this Bill, or have I wasted my time?
    Lee Mac ProgrammingTwitterExchange App StoreDropbox (500MB free)

    With Mathematics there is the possibility of perfect rigour, so why settle for less?

  5. #5
    Super Member Bill Tillman's Avatar
    Using
    AutoCAD 2014
    Join Date
    Oct 2008
    Location
    Miami, FL
    Posts
    1,068

    Default

    Registered forum members do not see this ad.

    Lee,

    I appreciate your interest. I've been distracted with some new assignments this week and some health issues. I plan to get back on this by Monday. The users are presently satisfied but that won't last long. Thanks again.
    It's deja vu, all over again.

Similar Threads

  1. Can't change dimension text size
    By Bill T in forum AutoCAD Beginners' Area
    Replies: 2
    Last Post: 24th Aug 2011, 02:33 am
  2. Profile Vert./Hor.
    By nyaromulo in forum Civil 3D & LDD
    Replies: 2
    Last Post: 2nd Apr 2009, 10:00 pm
  3. How to read polyline vert to file with name?
    By iztok13 in forum AutoLISP, Visual LISP & DCL
    Replies: 27
    Last Post: 29th Jan 2009, 01:18 pm
  4. Change Dimension Value
    By CAD<LIFE in forum AutoCAD Beginners' Area
    Replies: 6
    Last Post: 21st Jul 2008, 04:45 pm
  5. cant change dimension text size
    By b.muqlueen in forum AutoCAD 2D Drafting, Object Properties & Interface
    Replies: 9
    Last Post: 22nd Feb 2008, 03:46 pm

Bookmarks

Posting Permissions

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