Author Topic: publish with dsd-file  (Read 2239 times)

0 Members and 1 Guest are viewing this topic.

cadplayer

  • Bull Frog
  • Posts: 390
  • Autocad Civil3d, OpenDCL.Runtime, LISP, .NET (C#)
publish with dsd-file
« on: June 27, 2016, 09:08:01 AM »
Hello!
Can somebody help to explain how create row

... Setup=Setup_PdfCreator|C:\Temp\Drawing2.dwg ... in dsd-file


Code: [Select]
[DWF6Version]
Ver=1
[DWF6MinorVersion]
MinorVer=1
[DWF6Sheet:001]
DWG=H:\Dropbox\M31.1.dwg
Layout=001
Setup=Setup_PdfCreator|C:\Temp\Drawing2.dwg
OriginalSheetPath=H:\Dropbox\M31.1.dwg
Has Plot Port=0
Has3DDWF=0
[Target]
Type=6
DWF=C:\Users\dirros.CAD-Q\Documents\MyPublish2.pdf
OUT=C:\Users\dirros.CAD-Q\Documents\
PWD=
[PdfOptions]
IncludeHyperlinks=TRUE
CreateBookmarks=TRUE
CaptureFontsInDrawing=TRUE
ConvertTextToGeometry=FALSE
VectorResolution=1200
RasterResolution=400
[AutoCAD Block Data]
IncludeBlockInfo=0
BlockTmplFilePath=
[SheetSet Properties]
IsSheetSet=FALSE
IsHomogeneous=FALSE
SheetSet Name=
NoOfCopies=1
PlotStampOn=FALSE
ViewFile=FALSE
JobID=0
SelectionSetName=
AcadProfile=Civil3d_Speedy
CategoryName=
LogFilePath=
IncludeLayer=FALSE
LineMerge=FALSE
CurrentPrecision=
PromptForDwfName=TRUE
PwdProtectPublishedDWF=FALSE
PromptForPwd=FALSE
RepublishingMarkups=FALSE
PublishSheetSetMetadata=FALSE
PublishSheetMetadata=FALSE
3DDWFOptions=0 0


That isnīt working...

Code: [Select]
foreach (Container layout in layouts)
                        {

                            DsdEntry entry = new DsdEntry();

                            entry.DwgName = dialog.FileName;
                            entry.Layout = layout.name;
                            entry.Title = layout.name;
                            //entry.Nps = "AA";
                            entry.NpsSourceDwg = "C:\\Temp\\Drawing2.dwg";
                            entry.Nps = "Setup_PdfCreator";

                            collection.Add(entry);
                        }

cadplayer

  • Bull Frog
  • Posts: 390
  • Autocad Civil3d, OpenDCL.Runtime, LISP, .NET (C#)
Re: publish with dsd-file
« Reply #1 on: June 27, 2016, 09:46:08 AM »
Iīm thinking about may Page-Setup is not definition in currently activeDocument where I run publish
So answer perhaps copy Page-Setup from template into currently drawing
Is there a way, reading i no problem more copying

Code: [Select]
public static void ListPageSetupEx()
        {
            Document acDoc = Application.DocumentManager.MdiActiveDocument;

            // Create a new database object and open the drawing into memory
            Database acExDb = new Database(false, true);
            acExDb.ReadDwgFile("C:\\Temp\\Drawing2.dwg", FileOpenMode.OpenForReadAndAllShare, true, "");

            // Create a transaction for the external drawing
            using (Transaction acTrans = acExDb.TransactionManager.StartTransaction())
            {
                DBDictionary plSettings = acTrans.GetObject(acExDb.PlotSettingsDictionaryId,
                                                            OpenMode.ForRead) as DBDictionary;

                acDoc.Editor.WriteMessage("\nPage Setups: ");

                // List each named page setup
                foreach (DBDictionaryEntry item in plSettings)
                {
                    acDoc.Editor.WriteMessage("\n  " + item.Key);
                }

                // Abort the changes to the database
                acTrans.Abort();
            }
        }

In Drawing2 is saved my Page-Setup template with name "Setup_PdfCreator"