在Star-CCM+中,可以使用Java语言编写二次开发程序。要获取3D模型的空间范围,可以使用以下代码:
```java
//获取Active Simulation
Simulation simulation = getActiveSimulation();
//获取场景
Scene scene = simulation.getSceneManager().getScene("Geometry Scene 1");
//获取场景中的区域(Region)
Iterator<Region> regionIterator = scene.iterator();
while (regionIterator.hasNext()) {
Region region = regionIterator.next();
//获取Region中的Part
Iterator<Part> partIterator = region.getParts().iterator();
while (partIterator.hasNext()) {
Part part = partIterator.next();
//获取Part中的三维边界框(bounding box)
VectorMinXYZ = part.getBoundingBoxMin();
VectorMaxXYZ = part.getBoundingBoxMax();
//输出结果
System.out.println("Part: " + part.getPresentationName());
System.out.println("MinX: " + VectorMinXYZ.getX());
System.out.println("MinY: " + VectorMinXYZ.getY());
System.out.println("MinZ: " + VectorMinXYZ.getZ());
System.out.println("MaxX: " + VectorMaxXYZ.getX());
System.out.println("MaxY: " + VectorMaxXYZ.getY());
System.out.println("MaxZ: " + VectorMaxXYZ.getZ());
}
}
```
该代码可以获取场景中所有区域中所有Part的三维边界框(bounding box),
即模型的空间范围。您可以根据需要修改该代码以满足您的实际需求。