Create or edit 3D shapes via Surfer automation
Surfer Automation can be used to create and work with 3D objects including 3D polylines, 3D polygons, and 3D polymesh. Specifications for how to use 3D objects and methods in automation are outlined in Surfer's help here:
Example
This example demonstrates how to add a 3D polygon to a plot document.
Sub Main Set surf = GetObject(,"Surfer.Application") Set plotdoc1 = surf.Documents.Add(srfDocPlot) Set shapes1 = plotdoc1.Shapes Dim polygon3dcoordsXY(7) As Double polygon3dcoordsXY(0) = 1 : polygon3dcoordsXY(1) = 2 polygon3dcoordsXY(2) = 2 : polygon3dcoordsXY(3) = 2.5 polygon3dcoordsXY(4) = 3 : polygon3dcoordsXY(5) = 2.0 polygon3dcoordsXY(6) = 4 : polygon3dcoordsXY(7) = 2.5 Dim polygon3dcoordsZ(3) As Double polygon3dcoordsZ(0) = 1 : polygon3dcoordsZ(1) = 2 polygon3dcoordsZ(2) = 3 : polygon3dcoordsZ(3) =4 Set polygon3d = shapes1.AddPolygon3D(polygon3dcoordsXY, polygon3dcoordsZ) 'use the 3D polygon object from here on End Sub
Updated November 2021
Comments
0 comments
Please sign in to leave a comment.