Jump to content

Change Dimension Text pos vert


Bill Tillman

Recommended Posts

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).

 

(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:

 

(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:

 

(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.

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

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.

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...