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

SetClosestMediaName - why doesn't work?

3 REPLIES 3
Reply
Message 1 of 4
GrzesiekGP
638 Views, 3 Replies

SetClosestMediaName - why doesn't work?

Hello,

 

Has anyone got working exampe of SetClosestMediaName function?

I was trying everything and if I want to use this method, I'm always getting eInvalidInput.

 

Anyone knows why?

 

Thanks.

3 REPLIES 3
Message 2 of 4
norman.yuan
in reply to: GrzesiekGP

That method, according to the documentation in ObjectARX SDK (2012/13/14, that I downloaded), is not implemented.

 

I remembered in one of my drawing printing project, I also tried this method with very promising name in vain and only found out later it is not lmplemented in .NET API. Then I had to write my own code to find a closest printing media by looping through the available media sizes to compare them to the needed paper size.

 

HTH

Norman Yuan

Drive CAD With Code

EESignature

Message 3 of 4
fieldguy
in reply to: GrzesiekGP

I had the same problem and ended up with something like norman describes. This is what I used.

 

Dim medias As StringCollection = psv.GetCanonicalMediaNameList(ps)
                Dim mediafound As Boolean = False
                For j As Integer = 0 To medias.Count - 1
                    If psv.GetLocaleMediaName(ps, j) = "your page description" Then
                        psv.SetCanonicalMediaName(ps, medias.Item(j))
                        mediafound = True
                        Exit For
                    End If
                Next

 

 

 

Message 4 of 4
SENL1362
in reply to: fieldguy

And if you are looking for ClosestMedia based on height and width, a compare based on area avoid a few if's

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