ModraUp Ruby API Documentation Ruby API Reference

Class: ModraUp::SectionPlane

Overview

A non-destructive section plane belonging to the drawing context; component instances share the section settings defined within. Cannot be directly instantiated with new.

Examples:

ModraUp.active_model.entities.add_section_plane([0,0,5], [0,0,1]).activate

Instance Method Summary # collapse

Inherited from ModraUp::Drawingelement

Inherited from ModraUp::Entity

Instance Method Details

#hatch_pattern ⇒ ModraUp::HatchPattern, nil

Returns the section plane's fill pattern. It applies to cut regions that have neither a group or component pattern nor a material pattern.

Returns:

  • (ModraUp::HatchPattern, nil)

Examples:

sp = ModraUp.active_model.entities.grep(ModraUp::SectionPlane).first
sp.hatch_pattern if sp

#hatch_pattern=(hatch_pattern) ⇒ ModraUp::HatchPattern, nil

Sets the section plane's hatch pattern; nil removes the pattern.

Parameters:

  • hatch_pattern (ModraUp::HatchPattern, nil) The hatch pattern of this model.

Returns:

  • (ModraUp::HatchPattern, nil)

Raises:

  • [ArgumentError] The hatch pattern belongs to another model.

Examples:

model = ModraUp.active_model
sp = model.entities.grep(ModraUp::SectionPlane).first
sp.hatch_pattern = model.hatch_patterns.first if sp

#activate ⇒ ModraUp::SectionPlane

Activate the current section plane context, replacing any previously activated section plane.

Returns:

  • (ModraUp::SectionPlane)

Examples:

sp = ModraUp.active_model.entities.add_section_plane([0,0,5], [0,0,1])
sp.activate

#active? ⇒ Boolean

Query if the section plane is active within its context, independent of symbol hidden state.

Returns:

  • (Boolean)

Examples:

sp = ModraUp.active_model.entities.add_section_plane([0,0,5], [0,0,1])
sp.active?

#get_plane ⇒ Array<Float>

Returns the four coefficients of the context local plane.

Returns:

  • (Array<Float>)

Examples:

sp = ModraUp.active_model.entities.add_section_plane([0,0,5], [0,0,1])
sp.get_plane

#set_plane(plane) ⇒ ModraUp::SectionPlane

Modify the local section plane.

Parameters:

  • plane (Array) Point with normal or four coefficients.

Returns:

  • (ModraUp::SectionPlane)

Raises:

  • [ArgumentError] The normal is invalid.

Examples:

sp = ModraUp.active_model.entities.add_section_plane([0,0,5], [0,0,1])
sp.set_plane([0,0,-1,5])

#name ⇒ String

Retrieve the name of the section plane.

Returns:

  • (String)

Examples:

sp = ModraUp.active_model.entities.add_section_plane([0,0,5], [0,0,1])
sp.name

#name=(name) ⇒ String

Set the name of the section plane.

Parameters:

  • name (String) Name.

Returns:

  • (String)

Examples:

sp = ModraUp.active_model.entities.add_section_plane([0,0,5], [0,0,1])
sp.name = "Floor section"

#symbol ⇒ String

Read the section plane leader.

Returns:

  • (String)

Examples:

sp = ModraUp.active_model.entities.add_section_plane([0,0,5], [0,0,1])
sp.symbol

#symbol=(symbol) ⇒ String

Set the section plane label to a maximum of three characters.

Parameters:

  • symbol (String) Label.

Returns:

  • (String)

Raises:

  • [ArgumentError] Length exceeds three characters.

Examples:

sp = ModraUp.active_model.entities.add_section_plane([0,0,5], [0,0,1])
sp.symbol = "A1"