![]() The GetWorkbench command takes a string as an argument and returns a Workbench object. Set reference2 = hybridShapes1.Item("MyEndPt2") 'if code not working properly use msgbox to check reference name Set reference1 = hybridShapes1.Item("MyEndPt1") MinimumDistance = TheMeasurable.GetMinimumDistance(reference2) Set TheMeasurable = TheSPAWorkbench.GetMeasurable(reference1) 'built in check if needed 'MsgBox ("ref2=" & reference2.Name) 'get the SPAworkbench Dim TheSPAWorkbench As Workbench Set reference2 = hybridShapes1.Item( "MyEndPt2") 'if code not working properly use msgbox to check reference name 'MsgBox ("ref1=" & reference1.Name) Dim reference2 As Reference Set reference1 = hybridShapes1.Item( "MyEndPt1") Set hybridShapes1 = hybridBody1.HybridShapes 'active document must be a CATPart Dim documents1 As Documents For example, you can change it to measure a point to a plane by changing this line of code: This code can be used to measure between more than just two points. Notice the parameter and relation that were created automatically (the measure between shown was created manually to double check the macro worked properly): Msgbox "The endpoints are " & length1.ValueAsString & " apart." 'display the distance the endpoints are apart in a messagebox Set formula1 = relations1.CreateFormula("Formula.2", "", length1, "distance(`Geometrical Set.1\MyEndPt1` ,`Geometrical Set.1\MyEndPt2` ) ") 'make sure points are labeled MyEndPt1 and MyEndPt2 respectively 'create a new formula to link to the parameter Set length1 = parameters1.CreateDimension("", "LENGTH", 0.000000) 'create a new length type parameter, set its value to 0 for now ![]() Msgbox "The endpoints are " & length1.ValueAsString & " apart." End Sub Set formula1 = relations1.CreateFormula( "Formula.2", "", length1, "distance(`Geometrical Set.1\MyEndPt1` ,`Geometrical Set.1\MyEndPt2` ) ")įormula1.Rename "Distance" 'display the distance the endpoints are apart in a messagebox 'make sure points are labeled MyEndPt1 and MyEndPt2 respectively Dim formula1 As Formula Length1.Rename "MeasureDistance" 'create a new formula to link to the parameter Dim relations1 As Relations Set length1 = parameters1.CreateDimension( "", "LENGTH", 0.000000) 'create a new length type parameter, set its value to 0 for now Dim length1 As Dimension 'active document is a single part file Dim partDocument1 As Document Measures the shortest distance between a point and a cylindrical surface, as well as the radius of the cylinder and distance to cylinder axis.ĭisplays dimensions of a cylindrical surface.ĭisplays information about a selected 3D object, including name and attributes, membership in solid groups and identical copy groups, and definition of any sections.ĭisplays information about all objects in the 3D space, including number of solids, number of blanked solids, defined sections, assembly links and defined groups.'this macro creates a parameter and relation to measure the distance between two points Measures the shortest distance between a point and a plane. For more information, see Defining 3D Locations.ĭisplays 3D coordinates of a selected point.ĭisplays the distance between two selected points and DX, DY, DZ between the points. Some of these functions require location input. If multiple objects are selected, the calculation incorporates all objects into the results. The moment of inertia is calculated, and you can select or enter the mass density to change calculated result. The command calculates surface area of selected patches.ĭefine the axis about which the inertia is calculated and select the objects. Surface Area of Selected Patches - SELSAR Select the objects for surface area calculation. You can then select the mass density from the list of materials, or enter the mass density manually, to recalculate the mass. The calculation provides object volume and coordinates of the center of gravity. Volume, Mass, Surface and Moment of Inertia Calculations ![]() You can select, whether the results of volume, mass, moment of inertia and surface area calculation will be displayed in: Results units’ settings can be done from command “CFG”. 3D_Check_Functions.htm Checking Functions and Calculations Units of Calculation Results
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |