- Abfrage über Ja/Nein Dialog ob die Unsichtbaren Elemente gedruckt werden sollen…
- Einstellung wird gesetzt
- Verbindungen werden aktualisiert
- Dann öffnet sich der normale Drucken-Dialog (kann man nur auf das gesamte Projekt ausführen nicht auf „Markierte Seiten“)
- Einstellung wird bis zum nächsten starten des Buttons gespeichert.
Falls ihr den Druckdialog nicht starten möchtet dann löscht oder Kommentiert Zeile 58+59.
Suplanus - Scripts - Print-invisible-Objects (998 Downloads)
public class PrintInvisibleObjects
{
[DeclareAction("PrintInvisibleObjects")]
public void PrintInvisibleObjectsVoid()
{
////////////////////////////////////////////////////////////////////////
// Allgemeine Funktionen
////////////////////////////////////////////////////////////////////////
// Projektdatei, Projektpfad, Projektname
string sSelectedProjectData = string.Empty; // kompletter Pfad + Projektdateinamen + Erweiterung
string sSelectedProjectName = string.Empty; // Projektname
// Projektdatei komplett
CommandLineInterpreter oCLI = new CommandLineInterpreter();
Eplan.EplApi.ApplicationFramework.ActionCallingContext ctx = new Eplan.EplApi.ApplicationFramework.ActionCallingContext();
ctx.AddParameter("TYPE", "PROJECT");
bool bRet = oCLI.Execute("selectionset", ctx); // Action: Projektpfad
if (bRet == true)
{
ctx.GetParameter("PROJECT", ref sSelectedProjectData);
}
// Projektname
sSelectedProjectName = System.IO.Path.GetFileNameWithoutExtension(sSelectedProjectData);
////////////////////////////////////////////////////////////////////////
// Yes/No Abfrage
////////////////////////////////////////////////////////////////////////
// Setting
Eplan.EplApi.Base.Settings oSettings = new Eplan.EplApi.Base.Settings();
// Dialog
DialogResult oDialogResult = new DialogResult();
oDialogResult = MessageBox.Show("Sollen unsichtbare Elemente gedruckt werden?", "Drucken [" + sSelectedProjectName + "]", MessageBoxButtons.YesNo);
if (oDialogResult == DialogResult.Yes )
{
// Ja
oSettings.SetBoolSetting("USER.GedViewer.Print.PrintInvisibleObjects", true, 0);
}
else
{
// Nein
oSettings.SetBoolSetting("USER.GedViewer.Print.PrintInvisibleObjects", false, 0);
}
// Verbindungen aktualisieren
oCLI.Execute("EsGenerateConnections");
// Drucken-Dialog öffnen
oCLI.Execute("PrnPrintDialogShow");
return;
}
[DeclareMenu]
public void MenuFunction()
{
uint intIDUntermenue1; // MenuID
Eplan.EplApi.Gui.Menu oMenu = new Eplan.EplApi.Gui.Menu();
intIDUntermenue1 = oMenu.AddMainMenu(
"ePlanus", // Hauptmenüname
"Hilfe", // neben Menüpunkt...
"< ePlanus.de >", // Menüpunktname
"ePlanus", // Action
"ePlanus.de - Scripting in Eplan ist einfach (toll)", // Statustext
1 // Hinter Menüpunkt x
);
// Untermenüpunkte
oMenu.AddMenuItem(
"Print invisible objects...", // Menüpunktname
"PrintInvisibleObjects", // Action
"Sollen unsichtbare Elemente gedruckt werden?", // Statustext
intIDUntermenue1, // Menü-ID
1, // 1 = Hinter Menüpunkt X
false, // Seperator davor
false // Seperator dahinter
);
}
}
[…] Wire https://www.suplanus.de/print-invisible-objects/ предлагает скрипт с помощью которого можно выводить […]