Skip to main content
1-Visitor
February 21, 2011
Question

Create Rules for layers using Pro/toolkit

  • February 21, 2011
  • 13 replies
  • 2810 views

Hi,

Anybody know that how to create rules for layers, using Pro/Toolkit. Please share your ideas if you know how.

Thanks in advance,

BestRegards,

Joseph


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.

13 replies

15-Moonstone
May 12, 2011

Dear Sharon,


I have the same problem first. Problem everytimes come up when I wan't to get the Layers from the .prt on a .asm. So u need a model for .asm and a model for .prt both named similar. Then U can get the model name with or without the ending inside the parameter.


When you get the model inside the option u can create new layers with will automaticly get the specified rules from the template model. (created layer must have same name as copyed layer) than switch the layer options like Feliks says and everything works out perfect.


You can also get full path to part inside the config option. Sometimes it could help.


status = ProConfigoptSet( L"default_layer_model", L"c:/testpath/comeone/MyInsessionPart.prt" );

I've programmed the change Options in J-Link and Toolkit, both times it worked perfectly.


Thanks for ur help Feliks.


Regards,


Eike

FV_01
May 12, 2011

Hi all,


Sharon,


You should not use file extension while setting default_layer_model config option.


For plain Pro/E functionality, the procedure would be to create apart and an assembly file with the same name, and store it somewhere accessibleto Pro/E session either via search_path or byproviding afully qualified path.The layer part/assemblyshouldbe empty (no datums and so on). The config.pro example ( UNIX directory delimiters):


default_layer_model c:/standards/layer/layer_template


There must exist layer_template.prt.1 and layer_template.asm.1 (.1 is an example) in c:\standards\layer directory.


Where Toolkit concerned is when default_layer_model optionto be set dynamically via ProConfigoptSet. Based on the maintenance release of Pro/E the option may or may not take effect instantly especially if path to a layertemplate modelwas present. So, for times when Pro/E maintenance releasesstop working I wouldcopy (backup)layer template model(s) into the current working directory and thencall


ProConfigoptSet(L"default_layer_model", L"layer_template");


Again, I cannotpinpoint a problem tothe specific cut of Pro/E, but sometime ProConfigoptSet should be followed by the call ProMdlRetrieve( L"layer_template"...) and sometimes it wasworking without layer_template model(s) called into session. What deffinitelyis not working for WF5 is to call template layer model into session and then call ProConfigoptSet.The disk data has to be accessible to Pro/E.


HIH.


FV.

In Reply to Sharon Barber:



Feliks,


I have been following this thread as I, too, need to update parts with layers copied from another model (start part) and wish to maintain the layer rules. It is not working as I expected.


I am trying to use the ProConfigoptSet API as you have discussed and have found little information in the ProToolkit help documentation. I have the following line of code


ProError err = ProConfigoptSet(L"defaul_layer_model", L"MyInsessionPart.prt");


in which I have a part in session but not displayed (referred to here as MyInsessionPart.prt). This causes my ProEngineer to crash. I have tried this with and without including the ".prt" in the part name. Any suggestions would be greatly appreciated. At this time it is only test code, so I manually loaded the start part, then closed it such that it was in session, prior to running the test algorithm.



Regards,


Sharon B.


1-Visitor
May 25, 2011

Feliks and Eike,


Sorry for the delayed response. Since I'm prototyping this code in anticipation of future development, I have not been able to work on it continuously. Just wanted to thank both of you though. I did get my initial prototype code to work so I should be able to follow through with development to copy layers from one part to another without losing the layer rules.


Again, thank you both so much for the help.



Regards,


Sharon Barber