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

FV_01
February 21, 2011

Hi all,

Joseph,

Unfortunatelythere isn't Pro/Toolkit API for rule based layers. ( we were asking for it for years...)

-Trail file subscript or macro call from Pro/Toolkit is one ofthe options.

-using Pro/E functionality build around "default_layer_model" config option is another one.Works only with new features or geomitems.

- using ProLayerDefLayerSet and ProLayerDefLayerGet functions. Rule based layer functionality could be faked to some extentby using this method.

HIH.

Feliks.

1-Visitor
February 22, 2011

Hi Feliks,

Thank you very much, that is very useful information.

Regards,

Joseph

15-Moonstone
February 23, 2011

Thank u Feliks.

I searched for the same Term. I heard u can get layers out of other models and "import" / copy it to your model. But I don't find the right way to do it, now. But I'll try to have a look for ur last Option.

Bye,

Eike


FV_01
February 24, 2011

Hi all,

Eike,

Take a look at the 'Layer Status File' in Pro/E help - it describes how to use text files to build layering scheme...

default_layer_model has quite a number of related articles in 'Knowledge base'...

default_layer_model is a very powerfull option, it will assign layer rules to newly created layers sharing same names with the layers deifned in layer template model.Thenew layers in a model could be createdusing 'LayerStatus File' of Pro/Toolkit or J-ling or GUI. A layer with ruleswill be created automatically when a matching entity would be created in a model (for example, if template layer model has a rule based layer for datum planes then that layer will be automatically created in anactive model when a new datum plane was made). The new layer will not be associative and it will be dependent.

Thedrawbacks are: layer template model has to be in session...otherwise nothing would work, andthere is no API to make layer properties associative/non-associative and dependent/independent.Change of layer properties had to be handled by trail file script or macro.

I would personally use thistechnique when dealing with the mass editing/updating of old models to new layering standards or when starter templates to be made. Algorithm is simplistic:

-set up defaul_layer_model via ProConfigoptSet

-loop through models to be processed

-make/delete layers in model via ProLayerCreate/ProLayerDelete

-remove config option

-loop through models to be processed, again - run ProMacro... to make layer properties associative and independent - after this the layer will handle existing entities/features.

HIH.

Feliks.

In Reply to Eike Petersen:

Thank u Feliks.

I searched for the same Term. I heard u can get layers out of other models and "import" / copy it to your model. But I don't find the right way to do it, now. But I'll try to have a look for ur last Option.

Bye,

Eike


1-Visitor
May 5, 2011

I am not creating the model new, model already available. In the model, I would like to create rule based layer with rules like


1. datum with Name = XXX is to be added to the layer.---- (Name = XXX) LookBy: datum plane.


2. datum which is not available in other layer has to be added to current layer ----(Type = Datum Axis) and (! In layer "layer2")


Is this possible, with the method you suggest.



Thanks,


Joseph

FV_01
May 5, 2011

Hello all,


Joseph,


Questions:


-are rules to be associative and independent?


- are rules to be used for new features/geometry, existing features/geometry or both?


-are rules to be used for features or geomitems?


-are rules to berequired to perform'real-time' evaluation or evaluation could be postponed until some agreed uponevent?


FV.

In Reply to Isreavel Joseph:



I am not creating the model new, model already available. In the model, I would like to create rule based layer with rules like


1. datum with Name = XXX is to be added to the layer.---- (Name = XXX) LookBy: datum plane.


2. datum which is not available in other layer has to be added to current layer ----(Type = Datum Axis) and (! In layer "layer2")


Is this possible, with the method you suggest.



Thanks,


Joseph


1-Visitor
May 6, 2011

Hi Feliks,


Here are the answers,


1. Yes rules are associative and independant.


2. Rules are for both new featues and existing features.


3. Rules used for only features.


4. evaluation can be postponed, because other sequence of events occurse after rule creation.



Thanks,


Joseph

1-Visitor
May 6, 2011

Hi,


How to use 'LayerStatus File' option through Pro/toolkit.



Thanks,


Joseph

FV_01
May 6, 2011

Hello all,


Joseph,


IMHOyou don't need rule based layers. I would use ProNotify to capture model post regenerate and model pre save events and would use ProSolidFeatVisit to run a visit function to set feature layers. You would get better regeneration performance comparing to rule based layer approach and you would gain flexibilityif you ever needed to change companylayering standards.


HIH.


Feliks.



In Reply to Isreavel Joseph:



Hi Feliks,


Here are the answers,


1. Yes rules are associative and independant.


2. Rules are for both new featues and existing features.


3. Rules used for only features.


4. evaluation can be postponed, because other sequence of events occurse after rule creation.



Thanks,


Joseph


1-Visitor
May 11, 2011

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.