Jump to content

Rotating text


Tyke

Recommended Posts

I have a routine that selects all the text on a specific layer and then rotates the text to a specific angle.

 

If I have zoomed out so I can see all of the drawing and run the routine, everything is fine. But if I zoom in on part of the drawing and then run the routine not all of the text entities are rotated. The ones that are visible and those just outside of the screen area are rotated.

 

Has anyone come across this problem before and if so is there a solution.

 

I could always force a zoom extents, rotate the text and then zoom previous, but its not very clean.

Link to comment
Share on other sites

I was expecting you to be using an old version of Acad when I read that. One thing that has changed over the years is that the "L"ast object used to be the last drawn object visible on the current screen. It is now the very last object drawn. That caught me out a few times with scripts and I started putting in zoom extents, zoom previous just to make sure I got what I needed.

 

or to put it another way, I don't know another solution and I hope you find one as I'm interested too.

Link to comment
Share on other sites

Dave,

 

Just to be complicated, this is running on a machine with AutoCAD 2009, not on my machine with 2011. I'll try running it on 2011 and get back to you.

Link to comment
Share on other sites

How are you picking the selection set? It sounds like you are using either:

acSelectionSetWindow

acSelectionSetCrossing

 

If so, does the selection need to be restricted to an area (i.e., could you use a filtered acSelectionSetAll)?

Link to comment
Share on other sites

Here's the bit of code:

 

ThisDrawing.Utility.GetEntity obj, bsPT, "Pick text on text layer to be rotated ..."
   

Set SelLay = ThisDrawing.Layers.Add(obj.Layer)
SelectedLayer = SelLay.Name

fType(0) = 0
fData(0) = "TEXT"
fType(1) = 8
fData(1) = SelectedLayer

' regen all
ThisDrawing.Regen acAllViewports                 ' this was for Dave

Set ssText = AddSS("TEXT")
ssText.Select acSelectionSetAll, , , fType, fData

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