Line from Points Feature

Properties
Functions

Note:  Using an ID in “AddSegment” and then the selection function “AddSelectEdgeID” provides for much more reliable selections!


Line Body Function

The Line from Points feature can be created from existing points. These must be points defined by the Point feature. Naming it is optional. This feature can be created by either using AddSegment calls after creation function, LinePt(), or by putting the points in the selection list before calling LinePt(). If you put the points in the selection list first, via agb.AddSelect(agc.TypeFPoint, point), where GetPoint is used to get the point, there are two restrictions.

First, this method does not allow you to set the alignment vector. Second, a point can only be in the select list once, so this cannot be used if you need to use a point more than once. With either method, the feature is not complete until you issue the Regen() command.

Example
  var PF1 = agb.FPoint(agc.FPointConstruction, agc.FPointCoordinateFile);  //Creates basic feature
	PF1.Name = "TablePoints";  //This is not required
	PF1.CoordinateFile = "D:\\Samples\\Table.txt";
	agb.Regen();	//Feature not complete until this is done

	var LF1 = agb.LinePt();	//Creates basic feature
	LF1.Name = "TableTop";
	LF1.AddSegment(PF1.GetPoint(1, 1), PF1.GetPoint(1, 2));
	LF1.AddSegment(PF1.GetPoint(1, 2), PF1.GetPoint(1, 3));
	LF1.AddSegment(PF1.GetPoint(1, 3), PF1.GetPoint(1, 4));
	LF1.AddSegment(PF1.GetPoint(1, 4), PF1.GetPoint(1, 1));
	agb.Regen();	//Feature not complete until this is done

	var LF2 = agb.LinePt();
	LF2.Name = "TableLegs";
	LF2.Operation = agc.Frozen;	//Sets the Material property to Add Frozen
	//The following commands also set the alignment for the created edges
	//The zero value for the ID is because it is not used here
	LF2.AddSegment(PF1.GetPoint(1, 1), PF1.GetPoint(2, 1), 0, 1.0, 0.0, 0.0);
	LF2.AddSegment(PF1.GetPoint(1, 2), PF1.GetPoint(2, 2), 0, 0.0, 1.0, 0.0);
	LF2.AddSegment(PF1.GetPoint(1, 3), PF1.GetPoint(2, 3), 0, -1.0, 0.0, 0.0);
	LF2.AddSegment(PF1.GetPoint(1, 4), PF1.GetPoint(2, 4), 0, 0.0, -1.0, 0.0);
	agb.Regen();	//Feature not complete until this is done

	//Create Cross Section
	var CS1 = agb.CSRect(6.0, 4.5);  //Creates rectangular Cross Section 6 units wide by 4.5 units high
	var CS2 = agb.CSLSection(4.0, 4.0, 0.5, 0.5);  //Creates L section Cross Section

	//Assign Cross Section to Line Bodies created
	var num = LF1.GetNumBodies();
	var i;
	var body;
	for(i=1; i<= num; i++)
	{
	    body = LF1.GetBody(i);
	    if(body)
	        body.SetCrossSection(CS1);
	}
	num = LF2.GetNumBodies();
	for(i=1; i<= num; i++)
	{
	    body = LF2.GetBody(i);
	    if(body)
	        body.SetCrossSection(CS2);
	}

Release 18.2 - © ANSYS, Inc. All rights reserved.