.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Outline Size ModelSpace

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
mario.lung
344 Views, 2 Replies

Outline Size ModelSpace

Hey,

 

i Canot find the Outline Size of the Model

 

this is also not the right solution

Public Sub test()

Dim tPageSizeX As Double
Dim tPageSizeY As Double

Call ThisDrawing.ActiveLayout.GetPaperSize(tPageSizeX, tPageSizeY)
    
    tPageSizeX = Math.Round(tPageSizeX, 0)
    tPageSizeY = Math.Round(tPageSizeY, 0)
    
Debug.Print tPageSizeX
Debug.Print tPageSizeY
' 841 
' 2000 
End Sub

 

In the Picture you see the bigest block

 

 

maxSize.png

 

 

with this Information as Example

 

x = 290

y = 520

 

i want find the best papersize format for printing

and alos the paper rotation automaticaly

 

sry for my english but is not my favorite language

 

thx for help hints an tips

 

Mario

 

2 REPLIES 2
Message 2 of 3
SENL1362
in reply to: mario.lung

If there is nothing drawn outside your Sheet then you could use the Database Extents (db.UpdateExt(true); db.Extmin; db.Extmax).

Calculating the rotation may be possible when:
1. The Sheet is a Blockreference then use the rotation of the reference;
2. When every sheet has it's own width and height you can compare these sizes to an array filled with known sizes.
Message 3 of 3
mario.lung
in reply to: SENL1362

Hi,

 

thx for help 

 

i take this solution and it works fine now

 

            Dim oMax As Object = oAutoCADEditdoc.GetVariable("extmax")
            Dim oMin As Object = oAutoCADEditdoc.GetVariable("extmin")

            Dim sScaleFactor As String = oAutoCADEditdoc.GetVariable("CANNOSCALE")
            Dim oScaleFactor As Object = sScaleFactor.Split(":")

            Dim wec_format_x As String = Math.Round((CDbl(oMax(0)) - CDbl(oMin(0))) / CInt(oScaleFactor(1))).ToString
            Dim wec_format_y As String = Math.Round((CDbl(oMax(1)) - CDbl(oMin(1))) / CInt(oScaleFactor(1))).ToString

 

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost