Jump to content

Auto rotaing text to any UCS


BIGAL

Recommended Posts

We import from our GIS street maps inculding names and Street numbers. One of the things we do is often use a UCS so a street is shown as horizontal on the sheet, the only problem is that the street numbers are still at the angle of true world co-ords.

 

I had a search for a auto rotate text to view etc but did not find anything suitable, found some stuff but its not 100% meeting task. If some one has something please let me know.

 

Anyway as a work around if you have CIV3D you can do it fairly simple, take the text export it to a csv file and read it back in as CIV3D points apply a lable style showing description (original text) that has "orient to view" set and the text will always be displayed horizontal.

 

; converts text to xyz with text description 
; 
; by Alan H July 2016

(defun stnumlable ( / ss x y)
(setq oldsnap (getvar "osmode"))
(setvar "osmode" 0)
(alert "Make sure you have only the correct text layer on\n \nPress Esc now if you need to exit")
(setq ss (ssget))
(setq y (sslength ss))
(alert (strcat "You have picked " (rtos y 2 0 ) " St Numbers"))
(setq x (- (getint "Enter start point number") 1)) ;subtract 1 then add on in while
(setq fo (open "c:\\acadtemp\\Stnames.xyz" "W"))
(repeat (sslength ss)
 (setq en (entget (ssname ss (setq y (- y 1)))))
   ; Entity type
   (setq entyp (cdr (assoc 0 en))) 
   (if (= entyp "TEXT")
   (progn
   (setq xyz (cdr (assoc 10 en)))
   (setq txtstr (cdr (assoc 1 en)))
   (WRITE-LINE (STRCAT (RTOS (setq X (+ x 1)) 2 0) "," (RTOS (car xyz) 2 2) "," (RTOS (cadr xyz) 2 2) "," "0.0" "," txtstr) fo)
   )                         
   )                              
   
;end while
)
(close fo)
(alert "All done")
(setvar "osmode" oldsnap)
) ; defun
(princ )
(stnumlable)

Link to comment
Share on other sites

Close abr-CAD-abra it sets text to current ucs but I have 2 layouts which are orientated 90deg apart so ucs1 text correct, ucs2 its at 90 which is my problem.

Link to comment
Share on other sites

An alternative approach, if I understand correctly:

 

Using an attributed block (annotative) with 'Match Orientation to Layout' on:

 

Substitute all street name text entities with the named attributed block. The attribute value will be the text string of each street name(s).

 

Delete the original text string.

 

Code something like this:

http://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-routine-to-substitute-text-to-blocks-at-point-location/td-p/3585322

Link to comment
Share on other sites

For the block the text needs to be annotative. The annotative style does not need match to layout on. The text properties should be annotative yes with match orientation yes.

 

I think this is what your looking for...

 

Drawing3.dwg

Link to comment
Share on other sites

Iconeo thank you thats exactly what I wanted, works with multiple ucs and text is horizontal. I will have a good look at it and post a solution to my problem.

 

Dadgad thanks also.

Link to comment
Share on other sites

My hopes were dashed I am still going in circles, all I need in the block is one single attribute "st name" no line work, no extra anything, but the attribute text must appear horizontal no matter what UCS I use. If we need a line as a reference then put it on defpoints.

Link to comment
Share on other sites

pls. post the dwg. in cad, so its easier to understand what you want to do in cad with blocks. better save it to cad 2010 and post it.

Link to comment
Share on other sites

srini I thought I was clear create a block and all it has is one single attribute no lines, no arcs, no nothing else, the value of the attribute is a street number, it must always be horizontal no matter what UCS angle it seen in a layout, the UCS has no Z plane always = 0

Link to comment
Share on other sites

Could you humor us and post a block that isn't working, because looking at the info that is being given it does work for me.

ucs.JPG

The lines and circles are just to show the orientation of the viewports.

Edited by steven-g
Link to comment
Share on other sites

steven-g the problem how do I create it ! I know how to create a block with attributes etc but if I change the ucs the text appears at the wrong angle. Its about the dynamic settings. Thats what I am having problems with please post screen capture showing the steps etc. Where is this 'Match Orientation to Layout'

ScreenShot051.jpg

new block.dwg

Link to comment
Share on other sites

Thanks Steven-g and abr-CAD-abra the most obvious answer was right in front of me all the time. You look and just can not see. We do a bit of cleaning up of our GIS output so will add the correct style to all the text easy done.

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