Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Get document size in inches (Read 3937 times)
asloan
YaBB Newbies
*
Offline



Posts: 35
Joined: Mar 6th, 2006
Get document size in inches
Apr 26th, 2006 at 8:19pm
Print Post  
Is there a way to retrive or calculate the size of a FCX document in inches?  We generate very large diagrams (1500+ boxes) and need to print them on large format plotters.

When the user is laying out the diagram, it would be helpful if we could show them what the actual dimensions of the FCX document would be if printed.

I see the properties doc.(top, left, bottom, right) but am unsure as to what these relate to.

Thanks,
Alan
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Get document size in inches
Reply #1 - Apr 27th, 2006 at 4:51am
Print Post  
The DocLeft,DocTop, etc. properties define the origin and end of the document coordinate system measured in the current MeasureUnit. So the width of the document is DocRight- DocLeft and height = DocBottom - DocTop.

If MeasureUnit is uPoint, divide the width and height by 72 to find the size in inches. If  MeasureUnit is uDocument, divide them by 300. If using pixels, use the GetDeviceCaps API function to get the DPI resolution of the display and divide the document size by that value to find out the size in inches.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
asloan
YaBB Newbies
*
Offline



Posts: 35
Joined: Mar 6th, 2006
Re: Get document size in inches
Reply #2 - Apr 27th, 2006 at 10:55am
Print Post  
Thanks for your reply, however I'm using FCX 3.2.4 and I don't see a MeasureUnit property.  Is that something specific to 4.x?

If so, is there an equivalent in my version of the control?

Thanks,
Alan
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Get document size in inches
Reply #3 - Apr 27th, 2006 at 11:45am
Print Post  
MeasureUnit is a new feature in version 4. Sizes are always measured in pixels in version 3. There you can use GetDeviceCaps to get the pixels per inch value, and divide by it the size in pixels to find out the size in inches.

Stoyan
  
Back to top
 
IP Logged
 
asloan
YaBB Newbies
*
Offline



Posts: 35
Joined: Mar 6th, 2006
Re: Get document size in inches
Reply #4 - Apr 27th, 2006 at 4:49pm
Print Post  
Thanks!  Wouldn't using:

DPIx = 1440 / Screen.TwipsPerPixelx

be the same as using the API call?

The only problem I have now is...Lets say you have a diagram that is 20 inches wide and 1000 inches high and what is making it so high is one (or more) boxes that have a lot of boxes under it.  I would think that by collapsing that branch and doing a fitDocToObjects, would decrease the document height, but it does not.  The height of the document is still the same as it was with the long branch expanded.

Does FCX, knowing that the branch is collapsed, reserve room in the document for that branch?

Doing a print preview shows the document correctly paginated without all of the blank pages that would be taken by the collapsed branch.

Alan
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Get document size in inches
Reply #5 - Apr 27th, 2006 at 5:32pm
Print Post  
That looks correct to me.

Collapsing a branch just hides the nodes below, and FitDocToObjects includes the invisible objects. The only way to find the bottom-most Y value I can think of is to iterate all visible boxes and find the largest box.Bottom value.

Both print and print preview exclude the hidden items when paginating, so they shouldn't print blank pages.

Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint