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.

switch off a layer with weblink

weblinker

New member
Hi together


I need to know how to switch off a certain layer called _SOLID_GEOM with web link.


Does anybody have an idea how to do this.


The documentation which comes with Pro/Engineer installation is not very helpful, soI want to aske the specialists in the www.


Thank you very much in advance



Edited by: weblinker
 
<A name=553></A>
Now I found this in the Pro/E web.link documentation. But anyway, I've no idea how to make this code work.
To set the display type of a layer, use the function <STRONG =Strong>[/b]<STRONG =Strong>pfcScript.[/b]<STRONG =Strong>pwlLayerDisplaySet[/b]. The syntax is as follows:
<DL>
<DD> pwlLayerDisplaySet (
string MdlNameExt, // The full name of the model.
string LayerName, // The name of the layer.
integer DisplayType // The new display type. Use
// <STRONG =Strong>parseInt[/b] with this argument.
);
</PRE></DD></DL>
 
The pwl* stuff is old Pro/WebLink. I'm not sure if it still works, but there
are other ways to do it, so you really don't need that stuff.

Here are the very basic steps of blanking the "DATUMS" layer of the current
model:
var model = pfcGetProESession().CurrentModel;
var layer = model.GetItemByName( pfcCreate("pfcModelItemType").ITEM_LAYER, "DATUMS" );
layer.Status = pfcCreate("pfcDisplayStatus").LAYER_BLANK;
 
Hi Marc


Thanks for your reply.

One further question; does your code also work with Wildfire 2.0?


I tried your code butI get error messages in the WF 2.0 environment.


Regards


Juergen
 
<HTML>
<title>
Layer Manipulationen
</title>

<script src = "../jscript/pfcUtils.jss">
document.writeln ("Error loading script!");
</script>

<BODY face="Arial" bgcolor="#E7E9E0">

<H5> woe </H5>

<H1>Layer</H1>
<H3>Layer aus- einblenden</H3>
<HR>

<input type=button value="Solid off Surface on " id=button1 name=button1 onclick="SolidOff_SurfaceOn()">
<br>
<br>
<input type=button value="Solid on Surface off" id=button2 name=button2 onclick="SolidOn_SurfaceOff()">

<HR>
<HR>
<H3>Layer erzeugen</H3>
<HR>
<input type=button value="Geometric Tolerances " id=button3 name=button3 onclick="Gen_Lay_Geometric_Tolerances()">
<br>
<br>


<input type=button value="Finished Part&n bsp; " id=button4 name=button4 onclick="Gen_Lay_Finished_Part()">
<br>
<br>


<input type=button value="BOM Tabelle&nbsp ;&nbsp ; " id=button5 name=button5 onclick="Gen_Lay_BOM_Table()">

<HR>
<HR>

<SCRIPT>

// Get Session, Model.


var mGlob& nbsp; = pfcCreate("MpfcCOMGlobal");
var oSession = mGlob.GetProESession();
var oCurModel = oSession.CurrentModel;// oCurModel taucht h
 
The code that I posted has been used in WF2 and WF3.
What error are you getting exactly?

If you are including the pfcUtils.js that was provided by PTC,
then you don't have to define pfcCreate(). It's already in
there.
 
var mGlob& nbsp; = pfcCreate("MpfcCOMGlobal");
var oSession = mGlob.GetProESession();
var oCurModel = oSession.CurrentModel;// oCurModel taucht h
 
Weblinker, looks like you have an extra "s" in pfcUtils.jss, unless you are using a .jss extension for some reason.


<script src = "../jscript/pfcUtils.jss">
 

Sponsor

Articles From 3DCAD World

Back
Top