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

HOw can i give Custom sheet size while converting DWG to PDF

4 REPLIES 4
Reply
Message 1 of 5
wrenchinternal
420 Views, 4 Replies

HOw can i give Custom sheet size while converting DWG to PDF

Hi,
I Am trying to convert DWG(sheet size:A2*3) to PDF(sheet size:A2*3) file by using the below code

moActiveDoc = moAcadApp.GetType().InvokeMember("ActiveDocument",
BindingFlags.GetProperty, null, moAcadApp, null);

oActiveLayout = moActiveDoc.GetType().InvokeMember("ActiveLayout", System.Reflection.BindingFlags.GetProperty, null, moActiveDoc, null);

object[] oParams[0]="ISO_A0_(1189.00_x_841.00_MM";

oActiveLayout.GetType().InvokeMember("CanonicalMediaName",System.Reflection.BindingFlags.SetProperty, null, oActiveLayout, oParams);


but
oActiveLayout.GetType().InvokeMember("CanonicalMediaName",System.Reflection.BindingFlags.SetProperty, null, oActiveLayout, oParams);

its gives the error "invalid Input" becouse the oParams[0] value="ISO_A0_(1189.00_x_841.00_MM)",It works perfectly if i give the
oParams[0] ="ISO_A1_(594.00_x_841.00_MM)" (for A1 sheet size).

My Query is how can i give the custom sheet size value(A2*3)?

 

PLat form:C# .Net

OS=Windows 7 ,32 bit

 

Thanks in Advance

4 REPLIES 4
Message 2 of 5
Ron_M
in reply to: wrenchinternal

Without looking too far into what you have I had a long topic about custom sheet sizes.  There might be something helpful in there.  Basically our office uses all custom sheet sizes for plotting PDFs and I needed to come up with a way to do that.  With a lot of help from multiple people here I was able to convert the LocalMediaName to CanonicalMediaName.

 

Use Local Media Name

 

 

Message 3 of 5
wrenchinternal
in reply to: Ron_M

Thanks Ron_M,
Am not expertise in canonical methodes.I Will shorten the question
for A2*3 sheets i am uisng the string=ISO_A1_(594.00_x_841.00_MM) .That returns the error.so Instead of that which string i can use?


Note:for A1 sheet string is="ISO_A1_(594.00_x_841.00_MM)".it works perfectly.

 

PLease Help

 

Thanks ,

Manosh

Message 4 of 5
Ron_M
in reply to: wrenchinternal

So my understanding is that your A2*3 sheet size is custom correct? If that is so the sheet size is LOCALMEDIANAME. In order to use it you have to convert LOCALMEDIANAME to CANONICALMEDIANAME. Otherwise it will be looking for a size that is actually a "UserXXX" which was assigned to the custom size as its CANONICALMEDIANAME. All of that is laid out in my thread linked above.

If I'm wrong about it being a custom size created by you then I don't know at this time and I apologize for wasting your time.
Message 5 of 5
wrenchinternal
in reply to: Ron_M

Thanks  Ron_M,

 

I think You are in right track.But the issue is am not getting you properly.

The methode which i using to convert is

 

oActiveLayout.GetType().InvokeMember("CanonicalMediaName",System.Reflection.BindingFlags.SetProperty, null, oActiveLayout, oParams);

and the oParams[0]= ISO_A0_(1189.00_x_841.00_MM).

 

I have gone through your thred and i am not getting any proper guidence from that.Can u please give some more details regarding LocalMediaName and how can i implement in my code Snippet.

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