Knowledge Pattern : Sample (Suwon 2nd Gym Project)

Let udf(UserFeature)
Let i(Integer)
Let li(Line)
Let st(String)

i=1

For i while i <= `List_SpaceFrameLine\Size`
{

li=`List_SpaceFrameLine` ->GetItem(i)
st="SpPipe_"+ToString(i)

udf= CreateOrModifyTemplate("Knowledge_Pattern_Catalog|SpaceFrame_PipeGeo",`SpaceFrame_Pipe`   ,`Relations\Knowledge Pattern_SpacePipe\UDFs`  ,i)
udf->SetAttributeObject("CenterLine", li  )
udf.Name=st
udf.Color=`Pipe_Color`
EndModifyTemplate(udf)

i=i+1
}



Using the Object Browser

 The object browser guides you when writing a script. It allows you to access the keywords, operators and  feature attributes that can be used when working with Product Knowledge Template.


Rule's Rule

1. if나 else의 구문은 Rule에서 단 한번 사용이 가능하다.

2. else if의 사용은 무제한적으로 반복할수 있다.

Rule: Visualizable Type

Color Attribute

Allows you to get and set the color of a Generative Shape Design feature. The Color attribute is defined as a character string. When comparing values,  bear in mind that the color attribute must be written in lowercase and not in uppercase. The color can be specified either by its full name or by its hexadecimal value:


Show Attribute

Allows you to get/set the Show/NoShow mode of a Generative Shape Design feature. The Show/NoShow mode is to be set by a boolean (true/false).


Pick Attribute

Allows you to set the "Pickable" status of  a feature so that it can or cannot not be selected in the geometrical area. The Pick attribute is to be set by a boolean.


Layer attribute

Allows you to get/set the layer associated with a feature.


Examples

Expert Rule1
(for all) G:GSMCurve
 if G.Show == False
 then G.Show = True

Expert Rule2
(for all) P:GSMPoint
 P.Color = "blue"
 P.Show = False
 Message ("Curve pick is set to #", G.Pick)
 P.Layer = 1
 Message ("Point layer is set to #", P.Layer)

Change Object's Color in a Rule



OR