feeds | |
Споделете с приятел. | Споделете форума В,,, с,,,в,,,е,,,т,,,а,,, н,,,а,,, CAD/CAM/CAE/PLM i Вашия форум за социално споделяне |
Март 2024 | Нед | Пон | Вто | Сря | Чет | Пет | Съб |
---|
| | | | | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | Календар |
|
| | Web link? | |
| | Автор | Съобщение |
---|
Admin Admin
Брой мнения : 797 Местожителство : София, България Job/hobbies : CAD/CAM специалист Reputation : 3 Points : 7978 Registration date : 27.03.2008
| Заглавие: Web link? Вто 13 Май - 14:56:28 | |
| A discussion of what WebLink is, and is not
WebLink is one of the two free API's (JLink being the other) provided by PTC to create Pro/Engineer applications. According to PTC's documentation, WebLink is a Javascript based library for use within the embedded web browser.
That's sounds great, but it's about as accurate as describing a car as a pothole creator. Well, here in Detroit that's more true than not, especially on Van Dyke ... but I digress.
Truthfully, WebLink isn't really Javascript based at all. It's based on Microsoft's COM/ActiveX/OLE objects on Windows, and Mozilla's XP-COM on Unix. You don't even need to use Javascript. On Windows, you can use VBScript, Perl, Python, or any one of your favorite languages that can access COM objects.
Here's an example of using VBScript in a WebLink application:
<HTML><BODY> <SCRIPT type="text/vbscript"> function HitMe () dim mdlname Set pfccomglob = CreateObject("pfc.MpfcCOMGlobal") mdlname = pfccomglob.GetProESession.CurrentModel.FileName Document.getElementById("mdlname").innerHTML = "Name: " & mdlname msgbox("Name: " & mdlname) end function </SCRIPT> <form name="f"> <INPUT name="a" type=button value="Hit me!" onclick="HitMe()"> <div id="mdlname"></div> </form></BODY></HTML> To make matters worse, you don't even need to use the web browser! A Pro/Toolkit DLL can access the WebLink COM objects using C/C++ and can do so completely outside the confines of the web browser. The Pro/Toolkit DLL could also go as far as hosting your favorite scripting engine. The web browser is just one of many environments in which a WebLink application can run.
Here's the same example using Perl to access WebLink COM Objects from within a Pro/Toolkit DLL:
use Win32;use Win32::OLE;$pfccomglob = Win32::OLE->new('pfc.MpfcCOMGlobal');$mdlName = $pfccomglob->GetProESession->CurrentModel->FileName;Win32::MsgBox("Name: $mdlName"); To summarize, WebLink requires neither Javascript nor a web browser. That clears things up, right? Why is it called "WebLink"? Well, you can use it in a web browser, and all PTC software has to have the word "Link", as a result: WebLink!
Can you imagine the response had they called it Pro/COM, or ActiveXLink, or COM.Link? A resounding "huh?" would have echoed through the halls on Kendrick Street. I think the marketing guys got it right this time.
Anyway, using whatever language in whatever environment you desire, the huge benefit to WebLink is that it's a rapid prototyping system for Pro/Engineer applications. The code-test-code-test cycle can be repeated as quickly as you can refresh the web browser. Whether you intend to migrate the application to JLink, or leave it in the web browser, you can get a complex application written very, very quickly. That's what makes WebLink very powerful.
Learn it, you won't regret it. | |
| | | | Web link? | |
|
Similar topics | |
|
| Права за този форум: | Не Можете да отговаряте на темите
| |
| |
| |