neophyte Posted July 27, 2009 Share Posted July 27, 2009 Hi How can I found the scale of a viewport on my drawing. I want to write this informations in my cartouche I have only one tab (layout1) I could have more than one viewport, they should be all the same scale ex: If the result of Scale relative to Paper space= 0.0208xp Then I'm going to write 1/4"=1'-0" Thanks for your help Quote Link to comment Share on other sites More sharing options...
neophyte Posted July 29, 2009 Author Share Posted July 29, 2009 Hi The next time I'm going to do a better search The answer was just under my eyes:oops: http://www.cadtutor.net/forum/showthread.php?t=29175 This is was I extract from this link Sub PVPortScale() Dim strVpScaleStd As String Dim strVpScaleCust As String Dim Entity As AcadEntity Dim PVport As AcadPViewport Dim objLayout As AcadLayout Dim i As Integer For Each objLayout In ThisDrawing.Layouts If objLayout.Name <> "Model" Then ThisDrawing.ActiveLayout = objLayout ThisDrawing.MSpace = False For i = 1 To objLayout.Block.Count - 1 'avoid primary Paperspace PViewport Set Entity = objLayout.Block.Item(i) If TypeOf Entity Is AcadPViewport Then Set PVport = Entity strVpScaleStd = PVport.StandardScale strVpScaleCust = PVport.CustomScale If strVpScaleCust > 0 Then Exit For End If End If Next End If Next End Sub Now I have to find out how compare my result with a list. The list contains the correspondence of results ex. if strVpScaleStd = 30 the scale I have to write is 3/32"=1'0" Have good day! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.