Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X
Dear Reader,
Our purchase department is spending hours downloading manuallya dxf file for each drawing beforesending it to the manufacturer.
We like to automate this manual downloadfrom Windchill and would like to work with Excel (and VBA).
The number of the drawing to look for could be entered in the Excel list and the vba code could download the dxf file attached to the drawing and place this in a folder.
Does anyone have experience with this and likes to share his code ?
Best regards,
Bernard Wielfaert
Hi Shudh,
This seems to be a decent solution but requires heavy knowledge of the insides of Windchill which I do not have actually.
Can you shed some light on the REST full web service that needs to be written at the Windchill side ?
Best regards,
Bernard Wielfaert
Software Engineering
LVD Company NV Belgium
Hi Dax,
Yes, that sounds as a possible solution. Please send me more details.
Best regards,
Bernard Wielfaert
Software Engineering
LVD Company NV
Belgium
Hi Swamy,
Thanks for your reply.
I gave the "packages" a try but find that there is still much operations (clicking and searching) involved before one can send a package.
Working with Excel enables also the possibility that the numbers are imported from an ERP system, so we prefer to work with Excel.
Best regards,
Bernard Wielfaert
Software Engineering
LVD Company NV
Hi Stephen,
The dxf file is a secondary contents attachment to the drawing, seeattached picture. We are using WTParts as well. The drawing and 3Dmodel are associated the the WTPart.
Best regards,
Bernard Wielfaert
Software Engineering
LVD Company NV
Attached is the export (.qml file) for the report used in the example.
This may be helpful for those of you who haven't created a report using
Report Manager. You can import this .qml file into your development
environment.
Hope this helps,
Dax
Do you know a way to automate logging into Windchill from Excel? I have created a report and added it to Excel and would like to avoid having to log into the Windchill server when I refresh the report.
If there is a way to log into the server with no manual interaction, that would be great. I need to automate some reports for sharing with others, and need to get it to the point where once the Excel file is opened, it refreshes the web query automatically.
-marc
Hi Marc DeBower,
I haven't attempted to bypass the login in Excel but I've heard it can be done. I believe Jered Larsen figured out a way around the login. Maybe reach out to him and see if he still has this information?
Just to note, once you open excel and login, you shouldn't need to login again if you refresh of the query. At lease not with the ones we've created. If you do get the information, please post it back to the report page so we don't have to figure it out ourselves.
Good Luck,
Dax
Hi
You can try this vb code, it seem to bypass basic authentication used by Apache:
Public Sub testPDS()
DebugOn = True
Set FSO = New Scripting.FileSystemObject
Set XmlHttp = CreateObject("Microsoft.XMLHTTP")
USER_NAME = "xxxxxx"
USER_PASSWORD = "xxxxxx"
XmlHttp.Open "POST", "https://pds.ptc.com/Windchill/app/", False
XmlHttp.setRequestHeader "Content-Type", "text/xml"
XmlHttp.setRequestHeader "Authorization", "Basic " + Base64Encode(USER_NAME & ":" & USER_PASSWORD)
XmlHttp.send ""
If (DebugOn) Then
MsgBox XmlHttp.responseText
End If
End Sub
Let me know if this answers your question...
Regards,
Thanks for uploading the code, when I run it, I get this:
...and it doesn't seem to work.
This is exactly what I am trying to do, but the link doesn't show up in Marc's last post. Can you edit your post with the link Marc or give a brief explanation of what worked for you?
Thanks,
Matt