Jump to content

Dimension Text Direction & Position


Dave^

Recommended Posts

Hi Gents,

 

Long time no pester!!

 

I'm looking for a "easier" way of changing specific dimensions to read "right-to-left" and be positioned "below" the dim line.

 

Due to mvsetup, when rotating my views in my viewports, text on the Y-axis is upside down.

 

I know there's an way to change properties, i have "(vlax-property-available-p x 'explodable)" in a lisp (which I think I got from here) to change blocks from not being able to be exploded.

 

I've wasted an hour searching for a solution to a 5min problem... :lol:

 

Any hints?

Link to comment
Share on other sites

Try this Dave:

(defun c:dimupd ( / sel )
   (if (ssget "_:L" '((0 . "DIMENSION")))
       (progn
           (vlax-for obj
               (setq sel (vla-get-activeselectionset (vla-get-activedocument (vlax-get-acad-object))))
               (vla-put-dimtxtdirection obj :vlax-true)
               (vla-put-verticaltextposition obj acunder)
           )
           (vla-delete sel)
       )
   )
   (princ)
)
(vl-load-com) (princ)

Link to comment
Share on other sites

  • 1 year later...

Dear Lee,

 

From where did you get to know about "vla-put-dimtxtdirection", "vla-put-verticaltextposition" and acunder properties ?

 

The biggest problem in Visual LISP is that proper listing of all functions along with their explanation and properties are not available anywhere properly.

Link to comment
Share on other sites

  • 2 years later...

Great piece of code there Lee Mac, i would like however to it being able to change it back with the same command.

 

Something like

 

If (Dimension is normal) {
  - Change view direction to Right-to-Left
  - Change Text pos vert to Below
} else if (Dimension is allready changed) {
  - Change view direction back to Left-to-Right
  - Change Text pos vert back to Above
}

 

Would that be possible? (ofcourse it would :P) And how?

Link to comment
Share on other sites

Great piece of code there Lee Mac, i would like however to it being able to change it back with the same command.

 

Try the following:

(defun c:dimupd ( / sel )
   (if (ssget "_:L" '((0 . "DIMENSION")))
       (progn
           (vlax-for obj
               (setq sel (vla-get-activeselectionset (vla-get-activedocument (vlax-get-acad-object))))
               (vlax-put obj 'dimtxtdirection (~ (vlax-get obj 'dimtxtdirection)))
               (if (= acunder (vla-get-verticaltextposition obj))
                   (vla-put-verticaltextposition obj acabove)
                   (vla-put-verticaltextposition obj acunder)
               )
           )
           (vla-delete sel)
       )
   )
   (princ)
)
(vl-load-com) (princ)

  • Thanks 1
Link to comment
Share on other sites

  • 3 years later...
  • 1 year later...

Hello,

I'm looking to find a way to align multiple dimension text. The reason is that I'm using the Viewport and all dimension aren't visible. Attached are 2 drawings explaining my problem, to change the position, I manually copied the coordinates in the properties and inserted them in the dimensions I wanted to change.

Is it possible, by using the text position X or Y coordinate, to modify by lisp the other dimensions?

I have started the routine from this forum but I don't know how to make it work. I have no idea how to program lisp.

Can somebody help me please.

Many thank

DimensionAlignManualy.dwg Dimension.dwg DimTextMove.lsp

Link to comment
Share on other sites

Hello Bigal,

I think your proposal is not what I'm looking for.

When I'm working on the model space I would like to move the dimension text (in red) to the same x position as the visible dimension

image.thumb.png.3f3d674fbbf40d4c5ed4a0c039bcfcb2.png

 

 

Link to comment
Share on other sites

If you have the lisp is it open code or a FAS ? If open look for C:DTA or something similar that is the function command name after the c :

Edited by BIGAL
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...