Oasys.PRIMER.IGA2DBrep class

Properties

property IGA2DBrep.brid: integer

IGA2DBrep number. Also see the label property which is an alternative name for this

property IGA2DBrep.entries(read only): integer

Number of Parametric Face IDs (fid) added in IGA_2D_BREP. Can be used as index to add a new entry

property IGA2DBrep.exists(read only): boolean

true if IGA 2D Brep exists, false if referred to but not defined

property IGA2DBrep.include: integer

The Include file number that the IGA 2D Brep is in

property IGA2DBrep.label: integer

IGA2DBrep number. Also see the brid property which is an alternative name for this

property IGA2DBrep.model(read only): integer

The Model number that the IGA 2D Brep is in

Constructor

classmethod IGA2DBrep(model, details)

Create a new IGA2DBrep object

Parameters:
  • model (Model) – Model that IGA 2d brep will be created in

  • details (dict) –

    Details for creating the IGA2DBrep

    brid:

    (integer) ID of the IGA 2D Brep

Returns:

IGA2DBrep object

Return type:

IGA2DBrep

Example

To create a new IGA 2d brep in model m of id 10:

ig2b = Oasys.PRIMER.IGA2DBrep(m, {'brid':10})

Static methods

classmethod IGA2DBrep.Create(model, modal=Oasys.gRPC.defaultArg)

Starts an interactive editing panel to create a IGA 2D Brep

Parameters:
  • model (Model) – Model that the IGA 2D Brep will be created in

  • modal (boolean) – Optional. If this window is modal (blocks the user from doing anything else in PRIMER until this window is dismissed). If omitted the window will be modal

Returns:

IGA2DBrep object (or None if not made)

Return type:

IGA2DBrep

Example

To start creating a IGA 2D Brep in model m:

ig2b = Oasys.PRIMER.IGA2DBrep.Create(m)
classmethod IGA2DBrep.First(model)

Returns the first IGA 2D Brep in the model

Parameters:

model (Model) – Model to get first IGA 2D Brep in

Returns:

IGA2DBrep object (or None if there are no IGA 2D Breps in the model)

Return type:

IGA2DBrep

Example

To get the first IGA 2D Brep in model m:

ig2b = Oasys.PRIMER.IGA2DBrep.First(m)
classmethod IGA2DBrep.FirstFreeLabel(model, layer=Oasys.gRPC.defaultArg)

Returns the first free IGA 2D Brep label in the model. Also see IGA2DBrep.LastFreeLabel(), IGA2DBrep.NextFreeLabel() and Model.FirstFreeItemLabel()

Parameters:
  • model (Model) – Model to get first free IGA 2D Brep label in

  • layer (Include number) – Optional. Include file (0 for the main file) to search for labels in (Equivalent to First free in layer in editing panels). If omitted the whole model will be used (Equivalent to First free in editing panels)

Returns:

IGA2DBrep label

Return type:

int

Example

To get the first free IGA 2D Brep label in model m:

label = Oasys.PRIMER.IGA2DBrep.FirstFreeLabel(m)
classmethod IGA2DBrep.FlagAll(model, flag)

Flags all of the IGA 2D Breps in the model with a defined flag

Parameters:
  • model (Model) – Model that all IGA 2D Breps will be flagged in

  • flag (Flag) – Flag to set on the IGA 2D Breps

Returns:

No return value

Return type:

None

Example

To flag all of the IGA 2D Breps with flag f in model m:

Oasys.PRIMER.IGA2DBrep.FlagAll(m, f)
classmethod IGA2DBrep.GetAll(model, property=Oasys.gRPC.defaultArg)

Returns a list of IGA2DBrep objects or properties for all of the IGA 2D Breps in a model in PRIMER. If the optional property argument is not given then a list of IGA2DBrep objects is returned. If the property argument is given, that property value for each IGA 2D Brep is returned in the list instead of a IGA2DBrep object

Parameters:
  • model (Model) – Model to get IGA 2D Breps from

  • property (string) – Optional. Name for property to get for all IGA 2D Breps in the model

Returns:

List of IGA2DBrep objects or properties

Return type:

list

Example

To make a list of IGA2DBrep objects for all of the IGA 2D Breps in model m:

a = Oasys.PRIMER.IGA2DBrep.GetAll(m)

To return a list containing the value of property ‘foo’ (for example ‘x’ for a node) for each IGA 2D Brep in model m:

a = Oasys.PRIMER.IGA2DBrep.GetAll(m, 'foo')
classmethod IGA2DBrep.GetFlagged(model, flag, property=Oasys.gRPC.defaultArg)

Returns a list of IGA2DBrep objects for all of the flagged IGA 2D Breps in a model in PRIMER If the optional property argument is not given then a list of IGA2DBrep objects is returned. If the property argument is given, then that property value for each IGA 2D Brep is returned in the list instead of a IGA2DBrep object

Parameters:
  • model (Model) – Model to get IGA 2D Breps from

  • flag (Flag) – Flag set on the IGA 2D Breps that you want to retrieve

  • property (string) – Optional. Name for property to get for all flagged IGA 2D Breps in the model

Returns:

List of IGA2DBrep objects or properties

Return type:

list

Example

To make a list of IGA2DBrep objects for all of the IGA 2D Breps in model m flagged with f:

ig2b = Oasys.PRIMER.IGA2DBrep.GetFlagged(m, f)

To return a list containing the value of property ‘foo’ (for example ‘x’ for a node) for all of the IGA 2D Breps in model m flagged with f:

a = Oasys.PRIMER.IGA2DBrep.GetFlagged(m, f, 'foo')
classmethod IGA2DBrep.GetFromID(model, number)

Returns the IGA2DBrep object for a IGA 2D Brep ID

Parameters:
  • model (Model) – Model to find the IGA 2D Brep in

  • number (integer) – number of the IGA 2D Brep you want the IGA2DBrep object for

Returns:

IGA2DBrep object (or None if IGA 2D Brep does not exist)

Return type:

IGA2DBrep

Example

To get the IGA2DBrep object for IGA 2D Brep 100 in model m

ig2b = Oasys.PRIMER.IGA2DBrep.GetFromID(m, 100)
classmethod IGA2DBrep.Last(model)

Returns the last IGA 2D Brep in the model

Parameters:

model (Model) – Model to get last IGA 2D Brep in

Returns:

IGA2DBrep object (or None if there are no IGA 2D Breps in the model)

Return type:

IGA2DBrep

Example

To get the last IGA 2D Brep in model m:

ig2b = Oasys.PRIMER.IGA2DBrep.Last(m)
classmethod IGA2DBrep.LastFreeLabel(model, layer=Oasys.gRPC.defaultArg)

Returns the last free IGA 2D Brep label in the model. Also see IGA2DBrep.FirstFreeLabel(), IGA2DBrep.NextFreeLabel() and see Model.LastFreeItemLabel()

Parameters:
  • model (Model) – Model to get last free IGA 2D Brep label in

  • layer (Include number) – Optional. Include file (0 for the main file) to search for labels in (Equivalent to Highest free in layer in editing panels). If omitted the whole model will be used

Returns:

IGA2DBrep label

Return type:

int

Example

To get the last free IGA 2D Brep label in model m:

label = Oasys.PRIMER.IGA2DBrep.LastFreeLabel(m)
classmethod IGA2DBrep.NextFreeLabel(model, layer=Oasys.gRPC.defaultArg)

Returns the next free (highest+1) IGA 2D Brep label in the model. Also see IGA2DBrep.FirstFreeLabel(), IGA2DBrep.LastFreeLabel() and Model.NextFreeItemLabel()

Parameters:
  • model (Model) – Model to get next free IGA 2D Brep label in

  • layer (Include number) – Optional. Include file (0 for the main file) to search for labels in (Equivalent to Highest+1 in layer in editing panels). If omitted the whole model will be used (Equivalent to Highest+1 in editing panels)

Returns:

IGA2DBrep label

Return type:

int

Example

To get the next free IGA 2D Brep label in model m:

label = Oasys.PRIMER.IGA2DBrep.NextFreeLabel(m)
classmethod IGA2DBrep.RenumberAll(model, start)

Renumbers all of the IGA 2D Breps in the model

Parameters:
  • model (Model) – Model that all IGA 2D Breps will be renumbered in

  • start (integer) – Start point for renumbering

Returns:

No return value

Return type:

None

Example

To renumber all of the IGA 2D Breps in model m, from 1000000:

Oasys.PRIMER.IGA2DBrep.RenumberAll(m, 1000000)
classmethod IGA2DBrep.RenumberFlagged(model, flag, start)

Renumbers all of the flagged IGA 2D Breps in the model

Parameters:
  • model (Model) – Model that all the flagged IGA 2D Breps will be renumbered in

  • flag (Flag) – Flag set on the IGA 2D Breps that you want to renumber

  • start (integer) – Start point for renumbering

Returns:

No return value

Return type:

None

Example

To renumber all of the IGA 2D Breps in model m flagged with f, from 1000000:

Oasys.PRIMER.IGA2DBrep.RenumberFlagged(m, f, 1000000)
classmethod IGA2DBrep.Select(flag, prompt, limit=Oasys.gRPC.defaultArg, modal=Oasys.gRPC.defaultArg)

Allows the user to select IGA 2D Breps using standard PRIMER object menus

Parameters:
  • flag (Flag) – Flag to use when selecting IGA 2D Breps

  • prompt (string) – Text to display as a prompt to the user

  • limit (Model or Flag) – Optional. If the argument is a Model then only IGA 2D Breps from that model can be selected. If the argument is a Flag then only IGA 2D Breps that are flagged with limit can be selected (limit should be different to flag). If omitted, or None, any IGA 2D Breps can be selected. from any model

  • modal (boolean) – Optional. If selection is modal (blocks the user from doing anything else in PRIMER until this window is dismissed). If omitted the selection will be modal

Returns:

Number of IGA 2D Breps selected or None if menu cancelled

Return type:

int

Example

To select IGA 2D Breps from model m, flagging those selected with flag f, giving the prompt ‘Select IGA 2D Breps’:

Oasys.PRIMER.IGA2DBrep.Select(f, 'Select IGA 2D Breps', m)

To select IGA 2D Breps, flagging those selected with flag f but limiting selection to IGA 2D Breps flagged with flag l, giving the prompt ‘Select IGA 2D Breps’:

Oasys.PRIMER.IGA2DBrep.Select(f, 'Select IGA 2D Breps', l)
classmethod IGA2DBrep.SketchFlagged(model, flag, redraw=Oasys.gRPC.defaultArg)

Sketches all of the flagged IGA 2D Breps in the model. The IGA 2D Breps will be sketched until you either call IGA2DBrep.Unsketch(), IGA2DBrep.UnsketchFlagged(), Model.UnsketchAll(), or delete the model

Parameters:
  • model (Model) – Model that all the flagged IGA 2D Breps will be sketched in

  • flag (Flag) – Flag set on the IGA 2D Breps that you want to sketch

  • redraw (boolean) – Optional. If model should be redrawn or not after the IGA 2D Breps are sketched. If omitted redraw is true. If you want to sketch flagged IGA 2D Breps several times and only redraw after the last one then use false for redraw and call View.Redraw()

Returns:

No return value

Return type:

None

Example

To sketch all IGA 2D Breps flagged with flag in model m:

Oasys.PRIMER.IGA2DBrep.SketchFlagged(m, flag)
classmethod IGA2DBrep.Total(model, exists=Oasys.gRPC.defaultArg)

Returns the total number of IGA 2D Breps in the model

Parameters:
  • model (Model) – Model to get total for

  • exists (boolean) – Optional. true if only existing IGA 2D Breps should be counted. If false or omitted referenced but undefined IGA 2D Breps will also be included in the total

Returns:

number of IGA 2D Breps

Return type:

int

Example

To get the total number of IGA 2D Breps in model m:

total = Oasys.PRIMER.IGA2DBrep.Total(m)
classmethod IGA2DBrep.UnflagAll(model, flag)

Unsets a defined flag on all of the IGA 2D Breps in the model

Parameters:
  • model (Model) – Model that the defined flag for all IGA 2D Breps will be unset in

  • flag (Flag) – Flag to unset on the IGA 2D Breps

Returns:

No return value

Return type:

None

Example

To unset the flag f on all the IGA 2D Breps in model m:

Oasys.PRIMER.IGA2DBrep.UnflagAll(m, f)
classmethod IGA2DBrep.UnsketchAll(model, redraw=Oasys.gRPC.defaultArg)

Unsketches all IGA 2D Breps

Parameters:
  • model (Model) – Model that all IGA 2D Breps will be unblanked in

  • redraw (boolean) – Optional. If model should be redrawn or not after the IGA 2D Breps are unsketched. If omitted redraw is true. If you want to unsketch several things and only redraw after the last one then use false for redraw and call View.Redraw()

Returns:

No return value

Return type:

None

Example

To unsketch all IGA 2D Breps in model m:

Oasys.PRIMER.IGA2DBrep.UnsketchAll(m)
classmethod IGA2DBrep.UnsketchFlagged(model, flag, redraw=Oasys.gRPC.defaultArg)

Unsketches all flagged IGA 2D Breps in the model

Parameters:
  • model (Model) – Model that all IGA 2D Breps will be unsketched in

  • flag (Flag) – Flag set on the IGA 2D Breps that you want to unsketch

  • redraw (boolean) – Optional. If model should be redrawn or not after the IGA 2D Breps are unsketched. If omitted redraw is true. If you want to unsketch several things and only redraw after the last one then use false for redraw and call View.Redraw()

Returns:

No return value

Return type:

None

Example

To unsketch all IGA 2D Breps flagged with flag in model m:

Oasys.PRIMER.IGA2DBrep.UnsketchAll(m, flag)

Instance methods

IGA2DBrep.AssociateComment(comment)

Associates a comment with a IGA 2D Brep

Parameters:

comment (Comment) – Comment that will be attached to the IGA 2D Brep

Returns:

No return value

Return type:

None

Example

To associate comment c to the IGA 2D Brep ig2b:

ig2b.AssociateComment(c)
IGA2DBrep.Browse(modal=Oasys.gRPC.defaultArg)

Starts an edit panel in Browse mode

Parameters:

modal (boolean) – Optional. If this window is modal (blocks the user from doing anything else in PRIMER until this window is dismissed). If omitted the window will be modal

Returns:

no return value

Return type:

None

Example

To Browse IGA 2D Brep ig2b:

ig2b.Browse()
IGA2DBrep.ClearFlag(flag)

Clears a flag on the IGA 2D Brep

Parameters:

flag (Flag) – Flag to clear on the IGA 2D Brep

Returns:

No return value

Return type:

None

Example

To clear flag f for IGA 2D Brep ig2b:

ig2b.ClearFlag(f)
IGA2DBrep.Copy(range=Oasys.gRPC.defaultArg)

Copies the IGA 2D Brep. The target include of the copied IGA 2D Brep can be set using Options.copy_target_include

Parameters:

range (boolean) – Optional. If you want to keep the copied item in the range specified for the current include. Default value is false. To set current include, use Include.MakeCurrentLayer()

Returns:

IGA2DBrep object

Return type:

IGA2DBrep

Example

To copy IGA 2D Brep ig2b into IGA 2D Brep z:

z = ig2b.Copy()
IGA2DBrep.DetachComment(comment)

Detaches a comment from a IGA 2D Brep

Parameters:

comment (Comment) – Comment that will be detached from the IGA 2D Brep

Returns:

No return value

Return type:

None

Example

To detach comment c from the IGA 2D Brep ig2b:

ig2b.DetachComment(c)
IGA2DBrep.Edit(modal=Oasys.gRPC.defaultArg)

Starts an interactive editing panel

Parameters:

modal (boolean) – Optional. If this window is modal (blocks the user from doing anything else in PRIMER until this window is dismissed). If omitted the window will be modal

Returns:

no return value

Return type:

None

Example

To Edit IGA 2D Brep ig2b:

ig2b.Edit()
IGA2DBrep.Flagged(flag)

Checks if the IGA 2D Brep is flagged or not

Parameters:

flag (Flag) – Flag to test on the IGA 2D Brep

Returns:

True if flagged, False if not

Return type:

bool

Example

To check if IGA 2D Brep ig2b has flag f set on it:

if ig2b.Flagged(f):
    do_something..
IGA2DBrep.GetComments()

Extracts the comments associated to a IGA 2D Brep

Returns:

List of Comment objects (or None if there are no comments associated to the node)

Return type:

list

Example

To get the list of comments associated to the IGA 2D Brep ig2b:

comm_list = ig2b.GetComments()
IGA2DBrep.GetData(index)

Returns the data for fid in *IGA_2D_BREP

Parameters:

index (integer) – Index you want the data for. Note that indices start at 0

Returns:

The ID of parametric face, *IGA_FACE_UVW

Return type:

int

Example

To get the 3rd data entry in IGA 2d brep ig2b:

data = ig2b.GetData(2)
IGA2DBrep.GetParameter(prop)

Checks if a IGA2DBrep property is a parameter or not. Note that object properties that are parameters are normally returned as the integer or float parameter values as that is virtually always what the user would want. For this function to work the JavaScript interpreter must use the parameter name instead of the value. This can be done by setting the Options.property_parameter_names option to true before calling the function and then resetting it to false afterwards.. This behaviour can also temporarily be switched by using the IGA2DBrep.ViewParameters() method and ‘method chaining’ (see the examples below)

Parameters:

prop (string) – IGA 2D Brep property to get parameter for

Returns:

Parameter object if property is a parameter, None if not

Return type:

Parameter

Example

To check if IGA2DBrep property ig2b.example is a parameter:

Oasys.PRIMER.Options.property_parameter_names = True
if ig2b.GetParameter(ig2b.example):
    do_something...
Oasys.PRIMER.Options.property_parameter_names = False

To check if IGA2DBrep property ig2b.example is a parameter by using the GetParameter method:

if ig2b.ViewParameters().GetParameter(ig2b.example):
    do_something..
IGA2DBrep.Keyword()

Returns the keyword for this IGA 2d brep (*IGA_2D_BREP). Note that a carriage return is not added. See also IGA2DBrep.KeywordCards()

Returns:

string containing the keyword

Return type:

str

Example

To get the keyword for IGA 2d brep ig2b:

key = ig2b.Keyword()
IGA2DBrep.KeywordCards()

Returns the keyword cards for the IGA 2d brep. Note that a carriage return is not added. See also IGA2DBrep.Keyword()

Returns:

string containing the cards

Return type:

str

Example

To get the cards for IGA 2d brep ig2b:

cards = ig2b.KeywordCards()
IGA2DBrep.Next()

Returns the next IGA 2D Brep in the model

Returns:

IGA2DBrep object (or None if there are no more IGA 2D Breps in the model)

Return type:

IGA2DBrep

Example

To get the IGA 2D Brep in model m after IGA 2D Brep ig2b:

ig2b = ig2b.Next()
IGA2DBrep.Previous()

Returns the previous IGA 2D Brep in the model

Returns:

IGA2DBrep object (or None if there are no more IGA 2D Breps in the model)

Return type:

IGA2DBrep

Example

To get the IGA 2D Brep in model m before IGA 2D Brep ig2b:

ig2b = ig2b.Previous()
IGA2DBrep.RemoveData(index)

Removes fid for an index in *IGA_2D_BREP

Parameters:

index (integer) – The index you want to delete fid for. Note that indices start at 0, not 1

Returns:

No return value

Return type:

None

Example

To delete the fid for the 3rd index for *IGA_2D_BREP in model m:

if ig2b.entries >= 3:
    ig2b.RemoveData(2)
IGA2DBrep.SetData(index, fid)

Sets fid in *IGA_2D_BREP

Parameters:
  • index (integer) – Index you want to set the fid for. Note that indices start at 0

  • fid (integer) – The ID of parametric face

Returns:

No return value

Return type:

None

Example

To add an entry to the *IGA_2D_BREP ig2b with id 10 by using “entries” property to get the next available index:

i = ig2b.entries
ig2b.SetData(i, 10)

To change an entry in 3rd field for *IGA_2D_BREP ig2b with id 30:

ig2b.SetData(2, 30)
IGA2DBrep.SetFlag(flag)

Sets a flag on the IGA 2D Brep

Parameters:

flag (Flag) – Flag to set on the IGA 2D Brep

Returns:

No return value

Return type:

None

Example

To set flag f for IGA 2D Brep ig2b:

ig2b.SetFlag(f)
IGA2DBrep.Sketch(redraw=Oasys.gRPC.defaultArg)

Sketches the IGA 2D Brep. The IGA 2D Brep will be sketched until you either call IGA2DBrep.Unsketch(), IGA2DBrep.UnsketchAll(), Model.UnsketchAll(), or delete the model

Parameters:

redraw (boolean) – Optional. If model should be redrawn or not after the IGA 2D Brep is sketched. If omitted redraw is true. If you want to sketch several IGA 2D Breps and only redraw after the last one then use false for redraw and call View.Redraw()

Returns:

No return value

Return type:

None

Example

To sketch IGA 2D Brep ig2b:

ig2b.Sketch()
IGA2DBrep.Unsketch(redraw=Oasys.gRPC.defaultArg)

Unsketches the IGA 2D Brep

Parameters:

redraw (boolean) – Optional. If model should be redrawn or not after the IGA 2D Brep is unsketched. If omitted redraw is true. If you want to unsketch several IGA 2D Breps and only redraw after the last one then use false for redraw and call View.Redraw()

Returns:

No return value

Return type:

None

Example

To unsketch IGA 2D Brep ig2b:

ig2b.Unsketch()
IGA2DBrep.ViewParameters()

Object properties that are parameters are normally returned as the integer or float parameter values as that is virtually always what the user would want. This function temporarily changes the behaviour so that if a property is a parameter the parameter name is returned instead. This can be used with ‘method chaining’ (see the example below) to make sure a property argument is correct

Returns:

IGA2DBrep object

Return type:

IGA2DBrep

Example

To check if IGA2DBrep property ig2b.example is a parameter by using the IGA2DBrep.GetParameter() method:

if ig2b.ViewParameters().GetParameter(ig2b.example):
    do_something..
IGA2DBrep.Xrefs()

Returns the cross references for this IGA 2D Brep

Returns:

Xrefs object

Return type:

Xrefs

Example

To get the cross references for IGA 2D Brep ig2b:

xrefs = ig2b.Xrefs()