how to print with watermart with Ilogic?

how to print with watermart with Ilogic?

Darkforce_the_ilogic_guy
Advisor Advisor
557 Views
3 Replies
Message 1 of 4

how to print with watermart with Ilogic?

Darkforce_the_ilogic_guy
Advisor
Advisor

can anyone tell me how to print with an watermark with Ilogic ?

 

I have this code 

 

Dim oDrawDoc As Document
oDrawDoc = ThisApplication.ActiveDocument
Dim oSheet As Sheet = oDrawDoc.ActiveSheet


If oSheet.Size.ToString = "kA4DrawingSheetSize" Then



Dim oPrintMgr As PrintManager
oPrintMgr = oDrawDoc.PrintManager


'specify your printer name
oPrintMgr.Printer = "\\SRV\HP Color LaserJet M750 PCL 6 A4"

oPrintMgr.ColorMode = kPrintDefaultColorMode
oPrintMgr.Orientation = kLandscapeOrientation
oPrintMgr.PaperSize = PaperSizeEnum.kPaperSizeA4
oPrintMgr.Scalemode = 13827 'Custom Scale
oPrintMgr.ScaleMode = "1"
oPrintMgr.SubmitPrint


End If

If oSheet.Size.ToString = "kA3DrawingSheetSize" Then



Dim oPrintMgr As PrintManager
oPrintMgr = oDrawDoc.PrintManager
'specify your printer name
oPrintMgr.Printer = "\\SRV\HP Color LaserJet M750 PCL 6 A4"

oPrintMgr.ColorMode = kPrintDefaultColorMode
oPrintMgr.Orientation = kLandscapeOrientation
oPrintMgr.PaperSize = PaperSizeEnum.kPaperSizeA3
oPrintMgr.Scalemode = 13827 'Custom Scale
oPrintMgr.ScaleMode = "1"
oPrintMgr.SubmitPrint

End If

If oSheet.Size.ToString = "kA2DrawingSheetSize" Then



Dim oPrintMgr As PrintManager
oPrintMgr = oDrawDoc.PrintManager
'specify your printer name
oPrintMgr.Printer = "\\SRV\HP Designjet Z3200ps A2"

oPrintMgr.ColorMode = kPrintDefaultColorMode
'oPrintMgr.Orientation = kLandscapeOrientation
oPrintMgr.PaperSize = PaperSizeEnum.kPaperSizeA2
oPrintMgr.Scalemode = 13827 'Custom Scale
oPrintMgr.ScaleMode = "1"
oPrintMgr.SubmitPrint

End If

If oSheet.Size.ToString = "kA1DrawingSheetSize" Then



Dim oPrintMgr As PrintManager
oPrintMgr = oDrawDoc.PrintManager
'specify your printer name
oPrintMgr.Printer = "\\SRV\HP Designjet Z3200ps A1"

oPrintMgr.ColorMode = kPrintDefaultColorMode
'oPrintMgr.Orientation = kLandscapeOrientation
oPrintMgr.PaperSize = PaperSizeEnum.kPaperSizeA1
oPrintMgr.Scalemode = 13827 'Custom Scale
oPrintMgr.ScaleMode = "1"
oPrintMgr.SubmitPrint

End If

 

but I want to add an watermark Name Draft on the Drawing under Printer setting .. how do i do that ?

0 Likes
558 Views
3 Replies
Replies (3)
Message 3 of 4

Darkforce_the_ilogic_guy
Advisor
Advisor
Thank for the video ... but I am not sure if I can use this. What I want to do is to make my our print button. That add an water mark over the drawing saying Draft if it is printet form inventor.

My problem as this point is that one of my printer that I have to just ... does not have water mark ... second probleme is that I do not want it on the files that I check in in vault ... and I do not want any manual workflow what so ever... I want you to click a button. And then the program select the right printer .. the right papir size and I do not want the watermark on the file ... only as a printer setting or add before print and delete again
0 Likes
Message 4 of 4

GeorgK
Advisor
Advisor

Hello @Darkforce_the_ilogic_guy ,

 

you can create a sketched symbol with text. The font should be Swis721BdOulBT

 

Insert:

'Sub Main() 
' Set a reference to the drawing document.
' This assumes a drawing document is active.
Dim oDrawDoc As DrawingDocument = ThisDrawing.Document
 
' Obtain a reference to the desired sketched symbol definition.
Dim oSketchedSymbolDef As SketchedSymbolDefinition _
       = oDrawDoc.SketchedSymbolDefinitions.Item("Confidential")
 
Dim oSheet As Sheet = oDrawDoc.ActiveSheet
 
'create insertion point, coordinates - in cm !
Dim oTG As TransientGeometry = ThisApplication.TransientGeometry
Dim oInsertionPoint As Point2d = oTG.CreatePoint2d(25, 25)
 
' Add an instance of the sketched symbol definition to the sheet.
' Rotate angle = 0 radians,
' scale = 1 when adding
' no prompt text
Dim oSketchedSymbol As SketchedSymbol = oSheet.SketchedSymbols.Add(oSketchedSymbolDef, oInsertionPoint, (4 * Atan(1) * 45 / 180), 1, Nothing)
'End Sub

Delete:

'Define the drawing document
Dim oDrawDoc As DrawingDocument
oDrawDoc = ThisDoc.Document

'Iterate through each symbol in the active sheet
For Each oSymbol In oDrawDoc.ActiveSheet.SketchedSymbols
	'look for the symbol by name
	If oSymbol.Name = "Confidential" Then
		oSymbol.Delete
	End If
Next 

 

0 Likes