-
Thành viên cấp 4
anh search đươc cái này trên siemens em làm thử xem:
I actually found solution myself. togue
To create new picture via VBA you can use something like this:
Sub NewPicture()
Dim objDocument As Document
Dim FileName As String
Dim FolderPath As String
FileName = "NewPicture.pdl"
FolderPath = "C:\Program Files\Siemens\Step7\S7Proj\Step7ProjectName\wincpr oj\WinCCProjectName\GraCs\"
Set objDocument = Application.Documents.Add(hmiOpenDocumentTypeVisib le)
objDocument.BackColor = RGB(73, 73, 73)
objDocument.Width = 500
objDocument.Height = 500
objDocument.SaveAs (FolderPath & FileName)
objDocument.Close
End Sub
//================================================== ====================
And to modify existing picures this:
Sub AddNewObjectToPicture()
Dim objDocument As Document
Dim objObject As HMIObject
Set objDocument = Application.Documents.Open("C:\Program Files\Siemens\Step7\S7Proj\Step7ProjectName\wincpr oj\WinCCProjectName\GraCs\NewPicture.pdl")
Set objObject = ActiveDocument.HMIObjects.AddHMIObject("CircleAsHM IObject", "HMICircle")
objDocument.Save
objDocument.Close
End Sub
But there is still one existing problem. How do I search my GraCs folder for all .pdl files?
=== Edited by lvlcek @ 10/14/2012 2:09 PM [GMT ] ===
-
Tag của Chủ đề này
Quyền viết bài
- Bạn Không thể gửi Chủ đề mới
- Bạn Không thể Gửi trả lời
- Bạn Không thể Gửi file đính kèm
- Bạn Không thể Sửa bài viết của mình
-
Nội quy - Quy định
Back to Top
Múi giờ GMT +7. Bây giờ là 09:32 AM.
Phiên bản 4.2.5
Phát triển bởi thành viên PLCVietNam®.
Đánh dấu