CreateConeShape
This
function allows you to change a volume into a cone shape.
Signature
CreateConeShape(BaseDiameter : LENGTH, Height : LENGTH, Shape : Sys3DCone) : Integer
Arguments
| Name |
Input/Output |
Required? |
Type |
Comment |
BaseDiameter |
In |
|
LENGTH |
-
|
Height |
In |
|
LENGTH |
-
|
Shape |
Out |
|
Sys3DCone |
-
|
CreateCylinderShape
This
function allows you to change a volume into a cylinder shape.
Signature
CreateCylinderShape(BaseDiameter : LENGTH, Height : LENGTH, Shape : Sys3DCylinder) : Integer
Arguments
| Name |
Input/Output |
Required? |
Type |
Comment |
BaseDiameter |
In |
|
LENGTH |
-
|
Height |
In |
|
LENGTH |
-
|
Shape |
Out |
|
Sys3DCylinder |
-
|
CreatePadShape
This
function allows you to change a volume into a pad shape.
Signature
CreatePadShape(BaseWidth : LENGTH, BaseLength : LENGTH, Height : LENGTH, Shape : Sys3DPad) : Integer
Arguments
| Name |
Input/Output |
Required? |
Type |
Comment |
BaseWidth |
In |
|
LENGTH |
-
|
BaseLength |
In |
|
LENGTH |
-
|
Height |
In |
|
LENGTH |
-
|
Shape |
Out |
|
Sys3DPad |
-
|
Example
let volOcc (Sys3D_AbstractVolumeOccurrence)
let volInst (VPMInstance)
let volRef (Sys3D_AbstractVolume)
let listChild (LIST)
let newPos (Matrix)
let cvShape (Sys3DPad)
let dvShape (Sys3DSphere)
let ivShape (Sys3DCylinder)
let result (Integer)
let sName (STRING)
result = CreatePadShape(300mm, 300mm, 300mm, cvShape)
result = CreateSphereShape(200mm, dvShape)
result = CreateCylinderShape(300mm, 300mm, ivShape)
set listChild = ThisObject.Children
for volOcc inside listChild
{
set volInst = volOcc.Instance
set volRef = volOcc.Reference
if( (NULL <> volInst) and (NULL <> volRef))
{
// Set the instance name
set sName = volRef.V_Name + ".1"
volInst.PLM_ExternalID = sName
set result = 0
if( (true == volRef.IsASortOf("Sys3D_ComponentVolume")) and (NULL <> cvShape))
{
result = volRef.SetShape(cvShape)
if(0 <= sName.Search("CV1", 0, true))
{
set newPos = [1,0,0,0;0,1,0,0;0,0,1,0]
}
else
{
set newPos = [-1,0,0,3000;0,-1,0,0;0,0,1,0]
}
}
else if( (true == volRef.IsASortOf("Sys3D_DerivationVolume")) and (NULL <> dvShape))
{
result = volRef.SetShape(dvShape)
set newPos = [1,0,0,800;0,1,0,500;0,0,1,0]
}
else if( (true == volRef.IsASortOf("Sys3D_InterfaceVolume")) and (NULL <> ivShape))
{
result = volRef.SetShape(ivShape)
set newPos = [0,0,-1,1600;0,1,0,0;1,0,0,0]
}
// Set the position
volInst.PositionMatrix = newPos
}
}
CreatePathwayRouteElement
This
function lets you start or end a pathway on a branch point or on the extremity of another
pathway.
Signature
CreatePathwayRouteElement(PathwayGeometry : Sys3D_PathwayGeometryOccurrence, Pathway : Sys3DPathwayBranch, PathwayEnd : Feature, RouteElement : Sys3DPathwayRouteElement) : Integer
Arguments
| Name |
Input/Output |
Required? |
Type |
Comment |
PathwayGeometry |
In |
|
Sys3D_PathwayGeometryOccurrence |
-
|
Pathway |
In |
|
Sys3DPathwayBranch |
-
|
PathwayEnd |
In |
|
Feature |
-
|
RouteElement |
Out |
|
Sys3DPathwayRouteElement |
-
|
Create a Pathway branches between the volumes
let volOcc (Sys3D_AbstractVolumeOccurrence)
let volRef (Sys3D_AbstractVolume)
let cv1 (Sys3D_AbstractVolumeOccurrence)
let cv2 (Sys3D_AbstractVolumeOccurrence)
let iv1 (Sys3D_AbstractVolumeOccurrence)
let dv1 (Sys3D_AbstractVolumeOccurrence)
let pcpCV1 (Sys3D_PathwayConnectionPoint)
let pcpCV2 (Sys3D_PathwayConnectionPoint)
let pcpDV1 (Sys3D_PathwayConnectionPoint)
let pcp1IV1 (Sys3D_PathwayConnectionPoint)
let pcp2IV1 (Sys3D_PathwayConnectionPoint)
let listObj1 (LIST)
let listObj2 (LIST)
let sName(STRING)
let result (INTEGER)
// Find the volumes and their connection points in the volume parent
set listObj1 = VolumeParent.Query("Sys3D_AbstractVolumeOccurrence", "")
for volOcc inside listObj1
{
listObj2.RemoveAll()
set volRef = volOcc.Reference
if(NULL <> volRef)
{
result = volRef.ListPathwayConnectionPoints(listObj2)
}
set sName = volOcc.Name
if(0 <= sName.Search("CV1"))
{
set cv1 = volOcc
if(1 <= listObj2.Size())
{
set pcpCV1 = listObj2.GetItem(1)
}
}
else if(0 <= sName.Search("CV2"))
{
set cv2 = volOcc
if(1 <= listObj2.Size())
{
set pcpCV2 = listObj2.GetItem(1)
}
}
else if(0 <= sName.Search("DV1"))
{
set dv1 = volOcc
if(1 <= listObj2.Size())
{
set pcpDV1 = listObj2.GetItem(1)
}
}
else if(0 <= sName.Search("IV1"))
{
set iv1 = volOcc
if(2 <= listObj2.Size())
{
set pcp1IV1 = listObj2.GetItem(1)
set pcp2IV1 = listObj2.GetItem(2)
}
}
}
// 1.a Create Route elements for first pathway branch - between CV1\PCP1, point and IV1\PCP2
listObj1.RemoveAll()
let routeElement1 (Sys3DVolumeRouteElement)
result = CreateVolumeRouteElement (cv1,pcpCV1, routeElement1)
// Get the point inside pathway geometry
let ptRouteElem(Sys3DPointRouteElement)
listObj2 = ThisObject.Reference.Query("Point", "")
if(1 <= listObj2.Size())
{
result = CreatePointRouteElement (ThisObject, listObj2.GetItem(1), ptRouteElem)
}
let routeElement2 (Sys3DVolumeRouteElement)
result = CreateVolumeRouteElement (iv1,pcp2IV1, routeElement2)
if ( (NULL <> routeElement1) and (NULL <> ptRouteElem) and (NULL <> routeElement2))
{
listObj1.Append(routeElement1)
listObj1.Append(ptRouteElem)
listObj1.Append(routeElement2)
}
// 1.b Create Pathway Branch
let branchPt(CATEbm_BranchPoint)
let pathwayBr1 (Sys3DPathwayBranch)
result = ThisObject.CreatePathwayBranch(listObj1, pathwayBr1)
if(NULL <> pathwayBr1)
{
// 1.c. Create Branch point on the branch
listObj2.RemoveAll()
listObj2 = pathwayBr1.Query("CATEbm_ControlPoint","")
if(2 <= listObj2.Size())
{
result = pathwayBr1.CreatePathwayBranchPoint(listObj2.GetItem(2), branchPt)
}
}
// 2. Create Route elements for third pathway branch - between DV2\PCP1 and PathwayBranch.1\Branch point
listObj1.RemoveAll()
routeElement1 = NULL
result = CreateVolumeRouteElement (dv1,pcpDV1, routeElement1)
// Get the point inside pathway geometry
let pathRouteElem(Sys3DPathwayRouteElement)
result = CreatePathwayRouteElement (ThisObject, pathwayBr1, branchPt, pathRouteElem)
if ( (NULL <> pathRouteElem) and (NULL <> routeElement1))
{
listObj1.Append(pathRouteElem)
listObj1.Append(routeElement1)
}
let pathwayBr2 (Sys3DPathwayBranch)
result = ThisObject.CreatePathwayBranch(listObj1, pathwayBr2)
// 3. Create Route elements for second pathway branch - between CV2\PCP1 and IV1\PCP1
listObj1.RemoveAll()
routeElement1 = NULL
result = CreateVolumeRouteElement (cv2,pcpCV2, routeElement1)
routeElement2 = NULL
result = CreateVolumeRouteElement (iv1,pcp1IV1, routeElement2)
if ( (NULL <> routeElement2) and (NULL <> routeElement1))
{
listObj1.Append(routeElement1)
listObj1.Append(routeElement2)
}
let pathwayBr3 (Sys3DPathwayBranch)
result = ThisObject.CreatePathwayBranch(listObj1, pathwayBr3)
CreatePointRouteElement
This
function allows you to route the pathway through an existing 3D point.
Signature
CreatePointRouteElement(Part : ProductOccurrence, Point : Feature, RouteElement : Sys3DPointRouteElement) : Integer
Arguments
| Name |
Input/Output |
Required? |
Type |
Comment |
Part |
In |
|
ProductOccurrence |
-
|
Point |
In |
|
Feature |
-
|
RouteElement |
Out |
|
Sys3DPointRouteElement |
-
|
ReturnType
Integer
The function can return one of the following values:
- 0: The route element is created successfully.
- 1: The inputs are invalid. (example: The pathway connection point is not found in
the input volume occurrence).
CreateSphereShape
This
function allows you to change a volume into a sphere shape.
Signature
CreateSphereShape(Diameter : LENGTH, Shape : Sys3DSphere) : Integer
Arguments
| Name |
Input/Output |
Required? |
Type |
Comment |
Diameter |
In |
|
LENGTH |
-
|
Shape |
Out |
|
Sys3DSphere |
-
|
Example
let volOcc (Sys3D_AbstractVolumeOccurrence)
let volInst (VPMInstance)
let volRef (Sys3D_AbstractVolume)
let listChild (LIST)
let newPos (Matrix)
let cvShape (Sys3DPad)
let dvShape (Sys3DSphere)
let ivShape (Sys3DCylinder)
let result (Integer)
let sName (STRING)
result = CreatePadShape(300mm, 300mm, 300mm, cvShape)
result = CreateSphereShape(200mm, dvShape)
result = CreateCylinderShape(300mm, 300mm, ivShape)
set listChild = ThisObject.Children
for volOcc inside listChild
{
set volInst = volOcc.Instance
set volRef = volOcc.Reference
if( (NULL <> volInst) and (NULL <> volRef))
{
// Set the instance name
set sName = volRef.V_Name + ".1"
volInst.PLM_ExternalID = sName
set result = 0
if( (true == volRef.IsASortOf("Sys3D_ComponentVolume")) and (NULL <> cvShape))
{
result = volRef.SetShape(cvShape)
if(0 <= sName.Search("CV1", 0, true))
{
set newPos = [1,0,0,0;0,1,0,0;0,0,1,0]
}
else
{
set newPos = [-1,0,0,3000;0,-1,0,0;0,0,1,0]
}
}
else if( (true == volRef.IsASortOf("Sys3D_DerivationVolume")) and (NULL <> dvShape))
{
result = volRef.SetShape(dvShape)
set newPos = [1,0,0,800;0,1,0,500;0,0,1,0]
}
else if( (true == volRef.IsASortOf("Sys3D_InterfaceVolume")) and (NULL <> ivShape))
{
result = volRef.SetShape(ivShape)
set newPos = [0,0,-1,1600;0,1,0,0;1,0,0,0]
}
// Set the position
volInst.PositionMatrix = newPos
}
}
CreateVolumeRouteElement
This
function lets you start or end a pathway on the connection point of a volume.
Signature
CreateVolumeRouteElement(Volume : Sys3D_AbstractVolumeOccurrence, PathwayConnectionPoint : Sys3D_PathwayConnectionPoint, RouteElement : Sys3DVolumeRouteElement) : Integer
Arguments
| Name |
Input/Output |
Required? |
Type |
Comment |
Volume |
In |
|
Sys3D_AbstractVolumeOccurrence |
-
|
PathwayConnectionPoint |
In |
|
Sys3D_PathwayConnectionPoint |
-
|
RouteElement |
Out |
|
Sys3DVolumeRouteElement |
-
|
DirectionalLength |
In |
|
Length |
If any positive value is provided, the directional point is
created at this length. Otherwise, the value of the computed directional length
is twice the diameter. |
Sys3D_AbstractVolume.CreatePathwayConnectionPoint()
This
method lets you create a pathway connection point in a volume.
Signature
Sys3D_AbstractVolume.CreatePathwayConnectionPoint(Name : String, ClassificationID : String, AxisSystem : AxisSystem, PathwayCnctPt : Sys3D_PathwayConnectionPoint, PortCustoType : String]) : Integer
Arguments
| Name |
Input/Output |
Required? |
Type |
Comment |
Name |
In |
|
String |
-
|
ClassificationID |
In |
|
String |
-
|
AxisSystem |
In |
|
AxisSystem |
-
|
PathwayCnctPt |
Out |
|
Sys3D_PathwayConnectionPoint |
-
|
PortCustoType |
In |
|
String |
-
|
ReturnType
Integer
The method can return one of the following values:
- 0: The pathway connection points are created successfully. This function creates a
pathway connection point in the volume using input information.
- 1: The pathway connection point with input name already exists in the volume.
- 2: The classification ID is not valid in current environment.
- 3: The axis system is invalid.
- 4: The type name is invalid.
Notes:
- The axis system must be inside the volume and must not be published.
- By default, an object from the Sys3D_PathwayConnectionPoint type is created. To
create a customized type of pathway connection point, you must provide the custom type
name through an optional argument.
Create a Pathway Connection Point on a Volume
let volOcc (Sys3D_AbstractVolumeOccurrence)
let volRef (Sys3D_AbstractVolume)
let axisSys(axissystem)
let camPCP (Sys3D_PathwayConnectionPoint)
let result (Integer)
let sName(STRING)
let sPCPName(STRING)
let listChild (LIST)
let listAxis (LIST)
let index (INTEGER)
set listChild = ThisObject.Children
for volOcc inside listChild
{
set volRef = volOcc.Reference
if(NULL <> volRef)
{
set sName = volOcc.Name
Notify("#: Ref Found #", sName, volRef.V_Name)
set listAxis = volRef.Query("AxisSystem","")
if(NULL <> listAxis)
{
set index = 1
for axisSys inside listAxis
{
if (NULL <> axisSys)
{
set sPCPName = "PCP." + ToString(index)
set index = index+1
result = volRef.CreatePathwayConnectionPoint(sPCPName, "#6", axisSys, camPCP)
}
}
}
}
}
Sys3D_AbstractVolume.ListPathwayConnectionPoints()
This
method retrieves the pathway connection points in a volume.
Signature
Sys3D_AbstractVolume.ListPathwayConnectionPoints(ListPathwayCnctPts : List) : Integer
Arguments
| Name |
Input/Output |
Required? |
Type |
Comment |
ListPathwayCnctPts |
Out |
|
List |
-
|
ReturnType
Integer
The function can return one of the following values:
- 0: The function succeeds and the pathway connection points are listed.
- 1: The function succeeds, but the volume does not have any pathway connection
point.
- 2: The function fails.
List Pathway Connection Points
let volOcc (Sys3D_AbstractVolumeOccurrence)
let volRef (Sys3D_AbstractVolume)
let camPCP (Sys3D_PathwayConnectionPoint)
let result (Integer)
let sName(STRING)
let sPCPName(STRING)
let listChild (LIST)
let listPCP (LIST)
let index (INTEGER)
let sMsg (STRING)
set listChild = ThisObject.Children
for volOcc inside listChild
{
set volRef = volOcc.Reference
if(NULL <> volRef)
{
set sName = volRef.Name
result = volRef->ListPathwayConnectionPoints(listPCP)
if(NULL <> listPCP)
{
set sMsg = sName + ": "
for camPCP inside listPCP
{
set sMsg = sMsg + camPCP.V_FunctionalName + ", "
}
}
}
Notify(sMsg)
Sys3D_AbstractVolume.SetShape()
This
method allows to update the shape of a volume.
Signature
Sys3D_AbstractVolume.SetShape(Shape : Sys3DShape, CreatedShape : Sys3DShape, Representation : 3DShape]) : Integer
Arguments
| Name |
Input/Output |
Required? |
Type |
Comment |
Shape |
In |
|
Sys3DShape |
-
|
CreatedShape |
Out |
|
Sys3DShape |
-
|
Representation |
In |
|
3DShape |
-
|
ReturnType
Integer
The method can return one of the following values:
- 0: The shape is set successfully:
- If the 3Dshape already has a shape, it is modified
- If a volume has more than one 3D shapes, you must provide the 3Dshape in which
the shape is to be created using the Representation
optional argument.
- 1: The 3DShape is not found in volume.
Note:
By default, the shape must be set to find the 3Dshape of the
volume.
|