on 09-04-2023 6:29 AM
Hi team
Need your help to print a Power designer model diagram using VB script . I checked the meta model help and found the print method is at base diagram level
print()
Sends the display of the diagram to the default printer.I tried the below code to print the diagram using the script
For Each dia In mdl.AllDiagrams
set Mydiagram= Dia
Mydiagram.print
next
Shows error object does not support property or method . Can anybody help
Hello,
If this script is run like this outside PD Desktop then there is no model open yet.
You need
set mdl = PD.OpenModel ("C:\yourPath\yourModel.youExtension")
If you are trying to print the diagrams from Tool > Execute Commands > Edit/Run Script
and a model is open in the client then the following works fine in PD 16.7.7.0 which I tested:
Set mdl = ActiveModel
For Each dia In mdl.AllDiagrams
set MyDiagram = dia
MyDiagram.Print
Next
KR
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Arnaud
The PD model is opened on desktop before running the below script from the excel
I agree that the below script executes from the execute command from PD application .
Set mdl = ActiveModel
For Each dia In mdl.AllDiagrams
set MyDiagram = dia
MyDiagram.Print
Next
but its not executing from the excel file . I have the model opened , All are fine. I can run the other script to find out the objects and print
Set mdl = ActiveModel
For Each tb In mdl.Entities
Debug.print tb.Name ' I know this print is different . I have shown it for demo
Next
but some how pint diagram is not working from excel . In the execute command it may be using the PD print setting . while executing from the excel , it may not finding the printer setting . something is not working . I feel that some container issue for the print function . Any other solution? Thanks a lot
User | Count |
---|---|
75 | |
8 | |
8 | |
8 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.