cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X

Hide model's layer on drawing with Toolkit

AndreasHellmann
12-Amethyst

Hide model's layer on drawing with Toolkit

Hi,

I am trying to blank a layer in a drawing by TOOLKIT. It's no problem if the layer was created in the drawing, for example a layer named"NOTES" for controlling the notes' display.
In Pro/E's interactive mode it's possible in drw mode to blank/hide the layer "SURFACES" that is defined in parts only. The drw itself does not contain the layer, but you can hide the layer on the drawing to hide all surfaces on the drawing.

My question: Does anyone know how to hide/blank the layersin a drawing that are defined in models and parts only (by using Toolkit functions)?

Thanks,

Andreas

__________________________________

Andreas Hellmann
MCAD Services Pro/E & Pro/E customization
Rudolf-Diesel-Str. 6
D-65439 Floersheim / Germany

phone: +49 6145 598296
mail: -


This thread is inactive and closed by the PTC Community Management Team. If you would like to provide a reply and re-open this thread, please notify the moderator and reference the thread. You may also use "Start a topic" button to ask a new question. Please be sure to include what version of the PTC product you are using so another community member knowledgeable about your version may be able to assist.
8 REPLIES 8

Hi all,

Andreas,

The part/assembly layer belongs to a part or an assembly ProMdl. All you need to do is toget a list of drawing models, for each model do ProMdlLayerVisit or ProModelitemByNameInit in order to get ProLayer(s) listand use ProLayerDisplayStatusSet.

HIH.

FV.

Hi All,


We are facing similar problem with Andreas, but a little more complicate.


We have a drawing with 5 views (same drawing model), and we want each view has different layer display settings.


In Pro/E UI, we should change to each view’s layer object from layer tree, and setup the layer display status individually. (as attachment)


Trying to do it with toolkit, we just can’t find way to get those layer object and the layers.



Does anyone know how to set layer display status of those layer objects?



Thanks a lot


Shu-Fan

Hi All,


Shu-Fan, if Pro/Toolkit has access to drawing view layers thenget model(s) attached to each view,collect model(s) layer names, create layers with the same names in each vew, set your drawing option 'drawing layers override model layers' ( do not remember exact spelling), set view layer status as needed.


Feliks.

In Reply to Shu-Fan Wang:



Hi All,


We are facing similar problem with Andreas, but a little more complicate.


We have a drawing with 5 views (same drawing model), and we want each view has different layer display settings.


In Pro/E UI, we should change to each view’s layer object from layer tree, and setup the layer display status individually. (as attachment)


Trying to do it with toolkit, we just can’t find way to get those layer object and the layers.



Does anyone know how to set layer display status of those layer objects?



Thanks a lot


Shu-Fan


Here's some code where I blank STVlayer , and move an item from STGlayer to the blanked layer.
The dimensions belong to the models.

if (n == 1) /* if dim is starved -lost reference */
{
ProLayerDisplaystatusSet(&STVlayer, PRO_LAYER_TYPE_BLANK);
status = ProLayerItemInit(PRO_LAYER_DIMENSION, dim_array[dim_id], models[n], &layer_item);
ProLayerItemRemove(&STGlayer,&layer_item);
status = ProLayerItemAdd(&STVlayer,&layer_item);
/* fprintf(bugstream, "add to startved %d\n", status); */
}

Problem is I was using Pro_develop (and still am) to get the dimensions. Looks Like I have some work to do to get to CREO as Pro\develop is banned in Creo.
n = prodim_get_dimension(models[n], dim_array[dim_id], PRO_DIM_PARAM,&dim);



Hi All,


Thanks for you quick reply, Feliks


It works by following your suggestions, the key point is "create layers with the same names in each vew"


The drawing view can recognize thelayers created within drawing, and Pro/E will auto combine the layers with same name (include assembly & parts'), then you can hide/unhide layers as you want.


It really a smart way that we never think about.



Below are our steps for reference


1. ProDrawingFromTmpltCreate -> get drwhdl


2. ProDrawingGeneralviewCreate -> get view


3. Use dtl set :


draw_layer_overrides_model yes


ignore_model_layer_status yes


4. ProMdlLayerGet -> get layer


5. ProLayerCreate -> create same name layer


6. ProDwgLayerDisplaystatusSet -> hide layer



Thanks a lot


Shu-Fan




In Reply to Feliks Veysman:



Hi All,


Shu-Fan, if Pro/Toolkit has access to drawing view layers thenget model(s) attached to each view,collect model(s) layer names, create layers with the same names in each vew, set your drawing option 'drawing layers override model layers' ( do not remember exact spelling), set view layer status as needed.


Feliks.

In Reply to Shu-Fan Wang:



Hi All,


We are facing similar problem with Andreas, but a little more complicate.


We have a drawing with 5 views (same drawing model), and we want each view has different layer display settings.


In Pro/E UI, we should change to each view’s layer object from layer tree, and setup the layer display status individually. (as attachment)


Trying to do it with toolkit, we just can’t find way to get those layer object and the layers.



Does anyone know how to set layer display status of those layer objects?



Thanks a lot


Shu-Fan



@Mark:


The use of Pro\develop is stil possible in Creo 2.0. In Creo 3.0 as far as I know it is also possible.



Best regards,


Eike

Eike,

How do you figure the use of Pro/DEVELOP is still possible in Creo 2.0 and
3.0? If you want to run routines previously built with Pro/DEVELOP, then
the answer is yes. If you want to re-compile, particularly to use the new
UI, then, as far as I know, the answer is no.

In Creo 1.0, if memory serves me, PTC shipped Pro/DEVELOP libraries. In
Creo 2.0, they did not ship but could be requested.

Bob

Bob Monat
Jerand Technical Services, Inc.
bob@jerand.com
www.jerand.com
1-317-875-6087


Hi Bob,


yeah Sry I'm wrong about that. I have looked in the Creo 3.0 and there are no folder anymore and have the PTC Sources installed in my Creo 2.0.


But I have written to Mark (in a mail before, because I don't want to fill up these thread about other things ^^) that there are many new Toolkit functions to serve the missing prodb functions inside the Creo 3.0 Toolkit API. I have tested the run of the compiled prodb/Toolkit mixed applications in Creo 2.0 and 3.0 and everything is working (from the prodb commands I use in my application).



Best regards,


Eike

Announcements


Top Tags