Continue to Site

Welcome to MCAD Central

Join our MCAD Central community forums, the largest resource for MCAD (Mechanical Computer-Aided Design) professionals, including files, forums, jobs, articles, calendar, and more.

what am I doing wrong? (ActiveX)

2ms1

New member
I'm not sure this is the usual forum for this kind of question, but at least seemed like the best fit:


Could anyone tell me why I get an error on line 9 (the first line involving activex) that causes the following web page to not work? The error is listed as "pfcXNotConnectedToProE" in the explanation offered by IE.





<!cylinder dimensions form>
<html>
<head>
<title>Dimensions for Cylinder</title>
<script language="JavaScript">

function ParameterSetValues()
{
var sess = new ActiveXObject("pfc.MpfcCOMGlobal").GetProESession();
var model = new ActiveXObject("pfc.pfcModelDescriptor");
var item = new ActoveXObject("pfc.MpfcModelItem");
var window = sess.OpenFile(model.CreateFromFileName("cylinder.prt"));
var model = sess.GetModelFromFileName("cylinder.prt");

model.GetParam("cyl_diameter").Value=item.CreateDouble ParamValue(document.cl_design.diameter.value);
model.GetParam("cyl_length").Value=item.CreateDoublePa ramValue(document.cyl_design.length.value);model.Regenerate( null);
windowActivate();
window.Repaint();
}
</script>
</head>


<body>
<h1>Enter Cylinder Dimensions</h1>
<form name=cyl_design>
<p>Enter length: <input type=text name=length></p>
<p>Enter diameter: <input type=text name=diameter></p>
<button onclick='ParameterSetValues()' name=finished>ok</button>
</form>
</body>
</html>
 
Ok I have decided that it is likely that maybe the problem is that I don't have JavaScript enabled right in Pro/E?


I tried going into the only config.pro I could find (in some jlink folder) and adding WEB_ENABLE_JAVASCRIPT YES, but it didn't seem to do anything. Am I in the right config.pro file? This is really starting to bug me. I also tried using Tools>Options and adding the same WEB_ENABLE_JAVASCRIPT YES to the only config file that seemed to offer for modification (current_session.pro), but even with javascript enabled there, I still get the same error message.


Anyone here used a web page to modify parameters in a part?
 
I dont know if you already resolved your issue, but here is my $0.02.

Instead of trying to save a proe parameter fomr Tools>Options.

Just manually put the parameter into a new config.pro & place it in the a folder
that proe will read.

Go to folder <proe install / loadpoint>/text (usually D:\ptc\proeWildfire2)
Check for config.pro file there, if not create file: config.pro

Inside that file (new or existing), enter the parameter:

web_enable_javascript on

Post back if that does not work. The open proe prt's, asm's & drw's & open
web.link pages form this folder:

D:\ptc\proeWildfire2\weblink\weblinkexamples\html

Have Fun

L. Jett
 
First lets start with this...


Javascripts for Web.Link will throw the error or exception "pfcXNotConnectedToProE" if you areeither trying to open a web.link coded webpage into a web browser that is NOT the Pro/E embedded web browser...or...if you do NOT have the "web_enable_javascript" config.pro option set to "on".


So first ensure you are using the embedded browser then...To set the config.pro setting you first need to determine where you want to put the config.pro. You have to put the config.pro inthe Pro/E startup path, which usually works best in one of two locations...either in the <loadpoint>\text sub-folder (<loadpoint> being the directory where you installed Pro/E on your machine) or in your working directory that Pro/E starts up in (this varies depending on how you have Pro/E setup). Once you figure that out, simply create a file named config.pro (you can do that with Windowsnotepad) then enter a line exactly as follows:


web_enable_javascript on


and save the file in that location. Reload Pro/E then open your web page in the embedded browser inside Pro/E. Se if that works...if not there are other things you can try as well, but its a start.
Edited by: gcook
 
Thank you very much, I finally got it working with all your help. I guess there's no way to use it with and external browser? It would be so much nicer, for example for presentation purposes with a dual monitor setup or something, to be able to use an external browser.
 

Sponsor

Articles From 3DCAD World

Back
Top