Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void getDimensions() throws jxthrowable {
- // Get all features of the current model
- Model model = pfcGlobal.GetProESession().GetCurrentModel();
- Features features = ((Solid) model).ListFeaturesByType(false, null);
- // Get the dimensions of all features
- for (int i = 0; i < features.getarraysize(); i++) {
- Feature feat = features.get(i);
- ModelItems dims = feat.ListSubItems(ModelItemType.ITEM_DIMENSION);
- // Go through every single dimension
- for (int j = 0; j < dims.getarraysize(); j++) {
- Dimension dim = (Dimension) dims.get(j);
- if (dim != null) {
- String dimName = dim.GetName();
- double dimVal = dim.GetValue().GetDoubleValue();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement