Compiler and CM Language

Context Dump

A context dump has been added to the current crash information. This dump will do a less intrusive stack dump. The first frame will contain a dump of all registers, a +-32 byte dump around IP, and a +-512 byte dump around SP. The consequtive frames will dump the nonvolatile registers.

The regular stack dump can be found below the context dump.

cet.runtime

mcCheckForUpdatesHandler.cm

  • Changed the design of the notification banner when background install fails.
  • When the user closes CET, CET will now prompt the user to cancel any currently running updates before proceeding to exit CET.
  • Previously, the background install process attempted to register catalogues during the customizations Extension initialization step, which occurs as a side effect when the installer performs a sanity check by loading the install extensions. In some cases, this could result in the main CET instance encountering locked catalogue databases if they were in use by the background instance (and vice versa).
    Since catalogue downloads are managed by the foreground instance, the background instance is now no longer connected to the downloader. Manufacturers should note that any code using while loops to delay extension initialization until catalogue downloads complete may need adjustment, as this is not recommended behavior (or at least to avoid this during runningInInstallAndCloseMode).

cm.abstract.dataSymInterface.catalog

Changed: extend public double price(DsiPData data)

The logic for retrieving prices in the price method has been simplified by removing an unnecessary ProductCatalog reference check.

extend public double price(DsiPData data) {
	...
	
	if (data and prices and prices.seq.any) {
Old:		if (ProductCatalog prdCat = data.prdCatalog()) {
			if (PricelistType pricelist = data.pricelist()) {
				...
			}
		}
		return -0.0001;
	}
	return 0.0;
}

Old → New behavior

Old:

  • Previously, the method attempted to retrieve a ProductCatalog (data.prdCatalog()) before resolving the PricelistType
  • If no ProductCatalog was found, the logic would not proceed to pricing.

New:

  • The ProductCatalog check has been removed.
  • The method now only validates that a PricelistType exists.
  • If present, it retrieves the price and applies factors via addPriceFactors.

cm.abstract.dataSymbol

class DsPData

The following functions were introduced or modified to support the transition to the new part pricing system. Find more documentation on the new pricing system in the compile-time section for cm.core.part.Part.

Added: extend public bool useNewPartPricing() {}
Added: extend public Double optionPriceSum(SpecOption[] opts, Part part=null) {}
Added: extend public DsPart createPart(Snapper snapper, PartsEnv env, double basePrice, Double optionPriceSum) {}
Changed: extend public void getParts(Snapper snapper, PartsEnv env) {}

Added: extend public bool useNewPartPricing() {}

Indicates whether the new part pricing system should be used when generating Parts. An opt-in feature flag to the new pricing system.

Behavior
  • If a proxy is present, defers to proxy implementation.
  • Defaults to returning false (need to opt-in to new pricing system)
  • Versioning Notes
    • OLD system (≤16.0): Pricing based on cached list price only.
    • NEW system (≥16.5): Pricing based on cached base price + optionPriceSum.
Impact
  • Acts as the feature flag for determining which pricing path is followed in constructors, getParts, and createPart.
  • Developers should begin migrating logic to use base price + option price sum rather than raw list price.

Added: extend public Double optionPriceSum(SpecOption[] opts, Part part=null) {}

Calculates the total option prices from a collection of SpecOptions. Optionally takes a Part parameter to allow for special pricing scenarios.

Behavior
  • If a proxy is present, delegates calculation to the proxy.
  • Otherwise, iterates through provided options and sums upcharges.
  • Returns the sum wrapped in a Double.
Impact
  • Centralizes logic for calculating option-based pricing.
  • Developers no longer need to manually aggregate upcharges for SpecOptions.
  • Provides proxy support for flexible overrides.

Added: extend public DsPart createPart(Snapper snapper, PartsEnv env, double basePrice, Double optionPriceSum) {}

The createPart method was split into two overloads to support the new pricing framework. The new overload takes basePrice and optionPriceSum, while the old single-parameter version (using list price) has been marked for deprecation.

Old → New behavior

Old:

  • Single method signature:
    • createPart(Snapper snapper, PartsEnv env, double price)
  • Relied on a unified “list price” model.
  • Retained for backward compatibility.
  • Still used when useNewPartPricing is false

New:

  • New primary method:
    • createPart(Snapper snapper, PartsEnv env, double basePrice, Double optionPriceSum)
  • Constructs parts with explicit basePrice and optional optionPriceSum
  • Used when useNewPartPricing is true
Impact
  • Developers should migrate to the new overload using basePrice and optionPriceSum
  • Better alignment with the new pricing system, which separates base price and option prices.

Changed: extend public void getParts(Snapper snapper, PartsEnv env) {}

The getParts method was updated to integrate the new pricing model.

Old → New behavior

Old:

  • Always calculated part price using price(options)
  • Always created parts with createPart(..., price)
  • Cached copies of parts but did not reset option price sum state.
Old:
extend public void getParts(Snapper snapper, PartsEnv env) {
	...

	if (usePartsCache and cachedParts.any) {
		...
	} else if (prd) {
		...	    
	    double price = price(options);
		...
	    DsPart dpart = createPart(snapper, env, price);
	   ...
	}
}

New:

  • Introduces flag:
    • bool newPricing = useNewPartPricing();
    • If true → price comes from basePrice(), and new createPart uses new signature
    • If false → price comes from price(options), and createPart uses legacy signature
  • Cached part copies now call invalidateOptionPriceSum() to reset option-based pricing.
New:
extend public void getParts(Snapper snapper, PartsEnv env) {
	...

	if (usePartsCache and cachedParts.any) {
		for (c in cachedParts) {
			Part cpy = c.copy;
			...
			cpy.invalidateOptionPriceSum();
		}
	} else if (prd) {
		...
		bool newPricing = useNewPartPricing();
		double price = newPricing ? basePrice() : price(options);
		...
		DsPart dpart = newPricing ? createPart(snapper, env, price, null) : createPart(snapper, env, price);
		
		...
	}
}
Impact
  • Pricing flexibility: supports both old list price calculation and new base price + option prices model
  • Cache correctness: avoids stale option price values by invalidating option price on cached Parts
  • Compatibility: existing logic still works when useNewPartPricing() is disabled.

SIF Export

With the addition of the new part attribute description/notes system, DsPData now exports these values during SIF exports in generateConfiguraSifRows(..):

final package str[] generateConfiguraSifRows(DsPart part, Space space) {
	...

		//Attributes
New:	part.generateSifAnnotationRows(env.lines);

	return res;
}

class DsFreeformPData

Changed: extend public void initPricelist() {}

The logic for initializing a pricelistRef was simplified by replacing an early return with direct initialization when the reference is empty.

Old → New behavior

Old:

  • If pricelistRef was already set, the method returned immediately and did nothing.
  • Otherwise, it explicitly set pricelistRef to the current currency symbol before creating a new PricelistType.
Old: 
extend public void initPricelist() {
	if (pricelistRef.any()) return;
	str code = currentCurrencySymbol();
	pricelistRef = code;
	Date currentDate(date());
	dataCatalog.pricelists.put(pricelistRef, PricelistType(pricelistRef, pricelistRef, currentDate));
}

New:

  • If pricelistRef is empty, it is set to the current currency symbol.
  • Regardless of prior state, the method always inserts/updates the pricelistRef entry in dataCatalog.pricelists
New:
extend public void initPricelist() {
	if (pricelistRef.empty()) pricelistRef = currentCurrencySymbol();

	Date currentDate(date());
	dataCatalog.pricelists.put(pricelistRef, PricelistType(pricelistRef, pricelistRef, currentDate));
}

Changed: public DsPart createPart(..) {}

The createPart API was extended to support a new pricing model with separate basePrice and optionPriceSum parameters. The original listPrice version remains for backward compatibility but is now marked for deprecation.

Old → New behavior

Old:

  • Single createPart method signature:
    • public DsPart createPart(Snapper snapper, PartsEnv env, double price)
  • Pricing was passed as a single price (list price)
  • Called in getParts when useNewPartPricing is false

New:

  • New primary createPart method signature:
    • public DsPart createPart(Snapper snapper, PartsEnv env, double basePrice, Double optionPriceSum)
    • Separates base price from option price additions, allowing more flexible and accurate pricing.
  • Called in getParts when useNewPartPricing is true
Impact
  • More transparent pricing calculation with clearer separation of base vs. option-based prices
  • Developers should migrate from using listPrice to passing basePrice and optionPriceSum

Changed: public void getParts(Snapper snapper, PartsEnv env) {}

The getParts method was updated to support the new pricing model which is documented in the compile-time section for cm.core.part.Part. Instead of always creating parts with a single price, it now conditionally uses basePrice when the new pricing system is enabled.

Old → New behavior

Old:

  • Always created parts using:
    • DsPart dpart = createPart(snapper, env, freeformItem.price());
  • Relied solely on list price (price) for part creation.
Old:
public void getParts(Snapper snapper, PartsEnv env) {
	...
	if (usePartsCache and cachedParts.any) {
		...
	} else {
		DsPart dpart = createPart(snapper, env, freeformItem.price());
	    ...
	}
}

New:

  • Introduces conditional logic via useNewPartPricing():
    • If enabled → parts are created using basePrice (and optionPriceSum = null).
    • If disabled → falls back to old price-based method.
  • Caching and spec option handling remain unchanged.
New:
public void getParts(Snapper snapper, PartsEnv env) {
	...
	if (usePartsCache and cachedParts.any) {
		...
	} else {
		DsPart dpart;
		if (useNewPartPricing()) {
			dpart = createPart(snapper, env, freeformItem.basePrice(), null);
		} else {
			dpart = createPart(snapper, env, freeformItem.price());
		}
		...
	}
}
Impact
  • Supports transition to the new pricing system without breaking existing functionality.
  • Developers must be aware that part creation may now depend on either basePrice or price, depending on configuration.

class DsFreeformPicklistPart

Constructor Behavior Change: List Price → Base Price + Option Price Sum

The constructor for parts created from DsFreeformPData was updated to support the new pricing model. It now conditionally passes basePrice and optionPriceSum to the superclass instead of always relying on listPrice.

Old → New behavior

Old:

  • Always invoked superclass with DsFreeformItem price:
    • super(snapper, fpData, fpData.freeformItem.price(), qty);
  • Relied solely on list price for part initialization.

New:

  • Constructor now checks useNewPartPricing():
    • If enabled → calls superclass with basePrice and optionPriceSum=null.
    • If disabled → calls superclass with listPrice as before.
Impact
  • Parts are initialized with either listPrice or basePrice depending on pricing model configuration.
  • Developers relying on constructor parameters should be aware of the new basePrice/optionPriceSum path.

class DsPDataProxy

The following functions were introduced or modified to support the transition to the new part pricing system. Find more documentation on the new pricing system in the compile-time section for cm.core.part.Part.

Added: extend public bool useNewPartPricing(DsPDataProxyEnv dsEnv) {}
Added: extend public Double optionPriceSum(DsPDataProxyEnv dsEnv, SpecOption[] opts, Part part=null) {}
Added: extend public DsPart createPart(DsPDataProxyEnv dsEnv, PartsEnv env, double basePrice, Double optionPriceSum) {}

Added: extend public bool useNewPartPricing() {}

Allows proxy-aware code to check whether the new pricing system is enabled.

Behavior
  • Returns false by default. Need to opt-in to using new pricing system.
Impact
  • Enables consistent feature flag checks for new vs. old pricing when executing through proxies

Added: extend public Double optionPriceSum(DsPDataProxyEnv dsEnv, SpecOption[] opts, Part part=null) {}

A new overload of optionPriceSum was introduced to support execution through a DsPDataProxy, enabling proxy-aware option pricing calculations.

Behavior
  • Temporarily increments blockDataProxy to prevent recursive proxy calls.
  • Delegates the actual calculation to dsEnv.data.optionPriceSum(opts, part).
  • Ensures blockDataProxy is decremented in a finally block for safety.
Impact
  • Required when option price calculation must occur through a proxy environment (DsPDataProxyEnv).
  • Complements the existing non-proxy optionPriceSum(SpecOption[], Part) method.
  • Provides consistency in environments where proxy delegation is active.
  • Developers writing proxy-enabled logic should use this overload when a DsPDataProxy is available to ensure correct delegation.

Added: extend public DsPart createPart(DsPDataProxyEnv dsEnv, PartsEnv env, double basePrice, Double optionPriceSum) {}

The createPart method was split into two overloads to support the new pricing framework. The new overload takes basePrice and optionPriceSum, while the old single-parameter version (using list price) has been marked for deprecation.

Old → New behavior

Old:

  • Single method signature:
    • createPart(DsPDataProxyEnv dsEnv, PartsEnv env, double price)
  • Relied on a unified “list price” model.
  • Retained for backward compatibility.
  • Still used when useNewPartPricing is false

New:

  • New primary method:
    • createPart(DsPDataProxyEnv dsEnv, PartsEnv env, double basePrice, Double optionPriceSum)
  • Returns null by default
  • Used when useNewPartPricing is true
Impact
  • Proxy providers may implement this method to customize createPart behavior in the new pricing system.
  • Better alignment with the new pricing system, which separates base price and option prices.

cm.abstract.dataSymbol.ui.explorer

Changed: public void readProduct(str code, Scanner s)

The readProduct method was refactored to read the I1 SIF value during product import.

Old → New behavior

Old:

  • Did not support importing of I1 SIF code
    • No support of importing base price for DsFreeformItems

New:

  • Imports I1 to DsFreeformItem base price property

Changed: public void readOptions(str code, Scanner s, DsFreeformItem product)

The readOptions method was refactored to read the O1 SIF value during product option import.

Old → New behavior

Old:

  • Did not support importing of O1 SIF code
    • No support of importing option prices mapped to O1 for DsFreeformItems

New:

  • Imports O1 to DsFreeformItem price property for options/features

cm.abstract.engine.ofml

The following functions were introduced in OfmlPData to support the transition to the new part pricing system. Find more documentation on the new pricing system in the compile-time section for cm.core.part.Part and runtime section for cm.abstract.dataSymbol.DsPData.

Added: public double basePrice() {}
Added: public void specOption(DsSpecOption[] sOptions, Space space, SFeature f,
								Option o, DsPDataOption pDataOption, int level,
								bool choosableInCalculation) {}
Added: extend public void setOptionPrice(SpecOption option) {}
Added: public DsPart createPart(Snapper snapper, PartsEnv env, double basePrice, Double optionPriceSum) {}

Added: public double basePrice() {}

An override of basePrice has been added to OFMLPData to support the migration path to the new pricing model (≥16.5).

Old → New behavior

Old:

  • Delegated to superclass unless overridden.

New:

  • If useNewPartPricing() → returns only B-level row value from the pricelist.
  • If not → falls back to legacy super(..) implementation.

Impact

  • Returns base price in row (level "B") in the pricelist table.
  • Isolated logic (was previously inside price() method).

Added: public void specOption(DsSpecOption[] sOptions, Space space, SFeature f, Option o, DsPDataOption pDataOption, int level, bool choosableInCalculation) {}

The specOption(..) function has been overridden in OFMLPData to support pricing on an OFMLParts SpecOptions.

Old → New behavior

Old:

  • Delegated to superclass unless overridden.
  • specOption() never adjusted option pricing directly

New:

  • If new pricing is enabled → last option in the list gets priced via setOptionPrice()
  • If old pricing → bypasses new behavior (keeps legacy flow).

Impact

  • Ensures new options get priced correctly when added
  • Supports migration to the new pricing model (≥16.5).

Added: extend public void setOptionPrice(SpecOption option) {}

Added as a helper to the overridden specOption(..) function for setting SpecOption price.

Behavior

  • Looks up option rows (level "X") in the pricelist table.
  • Sets option.price directly.

Added: public DsPart createPart(Snapper snapper, PartsEnv env, double basePrice, Double optionPriceSum) {}

The createPart method was split into two overloads to support the new pricing framework. The new overload takes basePrice and optionPriceSum, while the old single-parameter version (using list price) has been marked for deprecation.

Old:

  • Single method signature:
    • createPart(Snapper snapper, PartsEnv env, double price)
  • Relied on a unified “list price” model.
  • Retained for backward compatibility.
    • Still used when useNewPartPricing is false

New:

  • New primary method:
    • createPart(Snapper snapper, PartsEnv env, double basePrice, Double optionPriceSum)
  • Constructs parts with explicit basePrice and optional optionPriceSum
  • Used when useNewPartPricing is true

Impact

  • Developers should migrate to the new overload using basePrice and optionPriceSum
  • Better alignment with the new pricing system, which separates base price and option prices.

Added: public DsPart createPart(DsPDataProxyEnv dsEnv, PartsEnv env, double basePrice, Double optionPriceSum) {}

The createPart method was split into two overloads to support the new pricing framework. The new overload takes basePrice and optionPriceSum, while the old single-parameter version (using list price) has been marked for deprecation.

Old → New behavior

Old:

  • Single method signature:
    • createPart(DsPDataProxyEnv dsEnv, PartsEnv env, double price)
  • Relied on a unified “list price” model.
  • Retained for backward compatibility.
  • Still used when useNewPartPricing is false

New:

  • New primary method:
    • createPart(DsPDataProxyEnv dsEnv, PartsEnv env, double basePrice, Double optionPriceSum)
  • Constructs Parts under the new pricing model constructor
  • Used when useNewPartPricing is true

Impact

  • Proxy providers may implement this method to customize createPart behavior in the new pricing system.
  • Better alignment with the new pricing system, which separates base price and option prices.

cm.abstract.k2.data

Changed: final private DsPart getPartsInternal(DsPDataProxyEnv dsEnv, PartsEnv env) {}

The internal getPartsInternal method now conditionally supports the new part pricing system. It can construct parts using either the legacy list-price–based approach or the new base-price–plus-options approach depending on useNewPartPricing().

Old → New behavior

Old:

  • Always retrieved a list price via:
    • double price = dsEnv.data.price(options);
  • SpecOption[] options were always passed into price() to calculate the full part cost.
  • Single pricing flow, no differentiation between base vs option pricing.

New:

  • Determines pricing strategy based on dsEnv.data.useNewPartPricing():
    • If true (new system):
      • Uses basePrice directly.
      • Passes null for optionPriceSum when calling createPart().
    • If false (legacy system):
      • Still calculates price from price(options) as before.

Impact

  • Introduces dual pricing support inside getPartsInternal()
  • Ensures compatibility during migration:
    • Legacy parts behave the same with no changes required.
    • New pricing model (≥16.5) leverages basePrice + option pricing separation.
  • Developers migrating to the new model should update workflows to split final list price into base price and option price sum

Added: public DsPart createPart(DsPDataProxyEnv dsEnv, PartsEnv env, double basePrice, Double optionPriceSum) {}

The createPart method was split into two overloads to support the new pricing framework. The new overload takes basePrice and optionPriceSum, while the old single-parameter version (using list price) has been marked for deprecation.

Old → New behavior

Old:

  • Single method signature:
    • createPart(DsPDataProxyEnv dsEnv, PartsEnv env, double price)
  • Relied on a unified “list price” model.
  • Retained for backward compatibility.
  • Still used when useNewPartPricing is false

New:

  • New primary method:
    • createPart(DsPDataProxyEnv dsEnv, PartsEnv env, double basePrice, Double optionPriceSum)
  • Constructs Parts under the new pricing model constructor
  • Used when useNewPartPricing is true

Impact

  • Proxy providers may implement this method to customize createPart behavior in the new pricing system.
  • Better alignment with the new pricing system, which separates base price and option prices.

cm.abstract.kitchen

Constructor Migration: List Price → Base Price + Option Price Sum

The multiple Kitchen Part class constructors have been expanded and split to support the new part pricing system (introduced in 16.5). New constructors now accept basePrice and optionPriceSum separately.

Old constructors that use list price will remain available until old pricing system is deprecated.

Classes affected:

  • KitchenFundamentalPart
  • KitchenSimpleLengthPart
  • KitchenDividedLengthPart
  • KitchenRackPart
  • KitchenBaseGablePart
  • KitchenFixedLengthPart
  • KxWorldPart

Impact

  • If you use list price constructors today → update to the new basePrice + optionPriceSum pattern
  • See new pricing API documentation in cm.core.part.Part compile-time section for more migration tips

New fields are available for some classes.

KitchenAutoMeasureGroupSnapper

New : public str key;

KitchenAutoMeasureGroup

New: public guid gid;
New: public str{} snapperGidSet();
New: public KitchenAutoMeasure->Snapper measureSnapperMap() : copy=null;
New: public symbol spaceVolumeId;

New methods are available for some classes.

KitchenAutoMeasureGroup

New: final public void generateGid(Int idx=null) {

KitchenGmc

New: extend public bool allowAutoElevations() : null=false {

cm.abstract.kitchen.externals

Changed: final private DsPart getPartsInternal(DsPDataProxyEnv dsEnv, PartsEnv env) {}

The internal getPartsInternal method now conditionally supports the new part pricing system. It can construct parts using either the legacy list-price–based approach or the new base-price–plus-options approach depending on useNewPartPricing().

Old → New behavior

Old:

  • Always retrieved a list price via:
    • double price = dsEnv.data.price(options);
  • SpecOption[] options were always passed into price() to calculate the full part cost.
  • Single pricing flow, no differentiation between base vs option pricing.

New:

  • Determines pricing strategy based on dsEnv.data.useNewPartPricing():
    • If true (new system):
      • Uses basePrice directly.
      • Passes null for optionPriceSum when calling createPart().
    • If false (legacy system):
      • Still calculates price from price(options) as before.

Impact

  • Introduces dual pricing support inside getPartsInternal()
  • Ensures compatibility during migration:
    • Legacy parts behave the same with no changes required.
    • New pricing model (≥16.5) leverages basePrice + option pricing separation.
  • Developers migrating to the new model should update workflows to split final list price into base price and option price sum

The createPart method was split into two overloads to support the new pricing framework. The new overload takes basePrice and optionPriceSum, while the old single-parameter version (using list price) has been marked for deprecation.

Old → New behavior

Old:

  • Single method signature:
    • createPart(DsPDataProxyEnv dsEnv, PartsEnv env, double price)
  • Relied on a unified “list price” model.
  • Retained for backward compatibility.
  • Still used when useNewPartPricing is false

New:

  • New primary method:
    • createPart(DsPDataProxyEnv dsEnv, PartsEnv env, double basePrice, Double optionPriceSum)
  • Constructs Parts under the new pricing model constructor
  • Used when useNewPartPricing is true

Impact

  • Proxy providers may implement this method to customize createPart behavior in the new pricing system.
  • Better alignment with the new pricing system, which separates base price and option prices.

cm.abstract.material

class COMPart

Constructor Behavior Change: List Price → Base Price + Option Price Sum

The COMPart constructor was updated to explicitly separate base price and option price sum when initializing the part.

Old → New behavior

Old:

  • Constructor directly passed a single list price (pricePerUnit()) into the superclass constructor.
  • No distinction between base price and option-derived price.

New:

  • Constructor passes basePrice=pricePerUnit() and optionPriceSum=0 to the superclass.
  • Establishes a clear separation of pricing components from the start.
  • Aligns COMPart creation with the new part pricing system
Impact
  • COMPart now integrates with the new pricing model that distinguishes base vs option costs.
  • Migration-friendly: existing behavior (price being equal to pricePerUnit()) is preserved since option sum is initialized as 0.
  • Enables future support for option-based price adjustments without changing constructor logic.

cm.abstract.materialHandling

MhFrameSpreadPatternBehavior changes

MhFrameSpreadPatternBehavior now returns false for strictClassification(MhSnapper snapper, str event), which means by default it no longer requires an exact classification LayerSet match for the spread to take place.

MhRowPopulateFunction changes

The existing engine function MhRowPopulateFunction has been replaced with MhRowPopulateFunction2 in the MH abstracts engine function library registered to the key rowPopulate. If you still want to use the old MhRowPopulateFunction, you should override the rowPopulate key in your extension's engine function library to do so.

MhBaySpawner and MhFrameSpawner changes

MhBaySpawner and MhFrameSpawner both now have implementations for configKey() and init(Snapper snapper). These methods were often implemented with the same code in many different extensions so we have now moved the code into these abstract classes. Check your spawner classes to see if these method implementations can be removed from them.

public class MhBaySpawner extends MhStorageSpawner {

    /**
     * Config key.
     */
    public symbol configKey() {
        str s = spnn(super().str, ".", "bay");
        return s.symbol;
    }


    /**
     * Init.
     */
    public void init(Snapper snapper) {
        super(..);
        if (snapper as MhSnapper) {
            snapper.config = createConfig();
        }
    }
}


public class MhSnapperSpawner extends SnapperSpawner {

    /**
     * Create new config.
     */
    extend public MhConfigRef createConfig() {
        return MhConfigRef(guid(), configKey);
    }
}

getAllSnappersInARow function changes

The function getAllSnappersInARow has been updated so that the default value for argument allowBackToBack is now false. allowBackToBack=true will result in including child snappers that do not intersect with the snapper in terms of y-bound. This change was made as that was the more common case in other extensions.

Old: public Snapper{} getAllSnappersInARow(MhSnapper snapper, SnapperFilter filter, bool allowBackToBack=true, Box ownerBound=null, MhSnapper parent=null) {
New: public Snapper{} getAllSnappersInARow(MhSnapper snapper, SnapperFilter filter, bool allowBackToBack=false, Box ownerBound=null, MhSnapper parent=null) {

For cases where you do want to include child snappers despite their y-bound, you will now have to call the function with allowBackToBack=true. This will include products like deep racking which has multiple frames, especially with a "Row" spread pattern.

We have added several methods to make it easier to pass in allowBackToBack=true for MhStorageRowSpreadPattern. You can either subclass MhStorageRowSpreadPattern and override its bool allowBackToBack(MhSnapper snapper) method, or override the snapper shape method bool allowBackToBackSpreadCandidates(MhSnapper snapper, MhSnapperSpreadPattern pattern) in your shape class.

public class MhStorageRowSpreadPattern extends MhSnapperSpreadPattern {

    New:
    /**
     * Allow back-to-back?
     */
    extend public bool allowBackToBack(MhSnapper snapper) {
        return snapper.?allowBackToBackSpreadCandidates(this);
    }
}


public class MhSnapper extends Snapper {

    New:
    /**
     * Allow back-to-back for spread pattern candidates?
     */
    extend public bool allowBackToBackSpreadCandidates(MhSnapperSpreadPattern pattern) {
        if (shape) return shape.allowBackToBackSpreadCandidates(this, pattern);
        return false;
    }
}


public class MhSnapperShape extends CorePropObj {

    New:
    /**
     * Allow back-to-back for spread pattern candidates?
     */
    extend public bool allowBackToBackSpreadCandidates(MhSnapper snapper, MhSnapperSpreadPattern pattern) {
        return false;
    }
}

Examples:

1. Essential Deep Racking
public class DrFrameShape extends GenRackFrameShape {

    /**
     * Allow back-to-back for spread pattern candidates?
     */
    public bool allowBackToBackSpreadCandidates(MhSnapper snapper, MhSnapperSpreadPattern pattern) {
        if (pattern in MhStorageRowSpreadPattern) return true;
        return super(..);
    }
}


2. Essential Cantilever Racking
public class CrStorageRowSpreadPattern extends MhStorageRowSpreadPattern {

    /**
     * Allow back-to-back?
     */
    public bool allowBackToBack(MhSnapper snapper) {
        if (animation as MhSnapperInsertToolAnimation) {
            ?MhSnapper inserter = animation.inserter;
            if (?CrSpreadSidesPatternBehavior b = inserter.?behavior("spreadPattern")) {
                return b.spreadSide.ieq("double");
            }
        }

        return super(..);
    }
}

Changes to selected snappers

As part of the changes to support multi-bays and multi-frames within a single row, we have made some modifications to MhStorageSelectionBehavior. The method void additionalFilteredSnappers(MhSnapper snapper, SnapperSelection sel, Line mouseLine) would append snappers of the same classification and "column" (same x-position) to the selection. This was mainly used for deep racking which would have multiple frames of the same x-position in a single row and usually we would want all of them to be included when one is selected. But this behavior is not wanted for multi-bays/multi-frames where they should be able to be individually selected even though they share the same x-position. We now feel this behavior should not be the default and have added an additional check bool selectAllOfSameColumn(MhSnapper snapper) to block or allow this behavior.

public class MhRowChildSelectionBehavior extends MhStorageSelectionBehavior {

    /**
     * AdditionalFilteredSnappers
     */
    extend public void additionalFilteredSnappers(MhSnapper snapper, SnapperSelection sel, Line mouseLine) {
        if (!selectAllOfSameColumn(snapper)) return;

        Snapper{} visited();
        SnapperFilter f = additionalFilter(snapper);

        ?MhSnapper row = snapper.rootParent;
        MhSnapper[] group = myRowGroup(row, visited, mhRowNotAisleFilter);

        for (r in group) {
            forChildren(c in r) {
                if (f.accepts(c)) {
                    sel << c;
                    forChildrenRecursive(cChild in c) {
                        sel << cChild;
                    }
                }
            }
        }
    }


    /**
     * AdditionalFilter
     */
    extend public SnapperFilter additionalFilter(MhSnapper snapper) {
        return MhCombinedFilter(MhClassificationSnapperFilter(snapper.classification),
                                MhSameColumnSnapperFilter(snapper));
    }


    New:
    /**
     * Return true if should select all child of the same column in a row.
     */
    extend public bool selectAllOfSameColumn(MhSnapper snapper) {
        if (!snapper.rootParent.?isDoubleDeep) return false;
        return true;
    }
}

We have also added a new behavior MhDeepstorageFrameSelectionBehavior in cm.abstract.materialHandling.storage.racking.deepstorage that overrides bool selectAllOfSameColumn(MhSnapper snapper) so that deep racking frames will still all be selected together. If you have a deep racking product but your frame spawner does not extend from MhDeepstorageFrameSpawner, make sure to append this new behavior to your frame spawner class. You should also do the same for other non-deep racking products that do require this behavior.

public class MhDeepstorageFrameSelectionBehavior extends MhRowChildSelectionBehavior {

    /**
     * Return true if should select all child of the same column in a row.
     */
    public bool selectAllOfSameColumn(MhSnapper snapper) {
        return true;
    }
}

Example usage:

public class MhDeepstorageFrameSpawner extends MhRackFrameSpawner {

    /**
     * CustomOtherBehaviors.
     */
    public MhBehavior[] customOtherBehaviors() {
        MhBehavior[] res = super(..);
        res.exclude(mhRowChildSelectionBehavior);
        res << mhDeepstorageFrameSelectionBehavior;
        return res;
    }
}

Changes to spread tools and dimension propagation

As part of the changes to support multi-bays and multi-frames within a single row, one aspect to consider is how to handle configurations (MhConfigRef). Typically a bay/frame that owns a non-temporary config will be visible in the bay/frame editor dialogs, and bays often display their config names in 2D.

One thing we have added to help support allowing either the child bays or the multi bay to own the non-temporary config is by adding this new method bool hasRealConfig(). Such snappers are considered to have a "real config" and is treated as a "config owner".

public class MhSnapper extends Snapper {

    /**
     * Check whether this snapper has config that is not temp.
     */
    extend public bool hasRealConfig() {
        if (config) return !config.temp;
        return false;
    }
}

We have also added a new SnapperFilter class MhConfigOwnerFilter that uses this new check.

public class MhConfigOwnerFilter extends SnapperFilter {

    /**
     * Accept
     */
    public bool accepts(Snapper s) {
        if (s as MhSnapper) {
            if (!s.hasRealConfig) return false;
        }
        return super(..);
    }
}

This new filter is now used in bay and frame spread tools to improve the experience of picking bays/frames as candidates. Now only "config owners" will be picked by these animations and snappers with temporary configs will be ignored. Note that this means if your snappers simply do not use "real configs" but you want the spread tools to work with them, you will have to override these filter methods to exclude mhConfigOwnerFilter.

public class MhBayPickupAnimation extends MhSnapperPickupAnimation {

    /**
     * Candidate filter.
     */
    public SnapperFilter candidateFilter() {
        static CombinedFilter cb(bayFilter, mhConfigOwnerFilter);
        return cb;
    }
}


public class MhBayApplyAnimation extends MhSnapperApplyAnimation {

    /**
     * CandidateFilter
     */
    public SnapperFilter candidateFilter() {
        SnapperFilter sf = super();
        return CombinedFilter(mhNotDoubleDeepRowFilter, mhConfigOwnerFilter, sf);
    }
}


public class MhFramePickupAnimation extends MhSnapperPickupAnimation {

    /**
     * Candidate filter.
     */
    public SnapperFilter candidateFilter() {
        return CombinedFilter(frameFilter, mhConfigOwnerFilter);
    }
}


public class MhFrameApplyAnimation extends MhSnapperApplyAnimation {

    /**
     * CandidateFilter
     */
    public SnapperFilter candidateFilter() {
        SnapperFilter sf = super();
        return CombinedFilter(frameFilter, sf, mhConfigOwnerFilter);
    }
}

MhBayRowEngineBehavior has also received a change related to "config owners". Now when propagating depth or height changes, we will only propagate to bays/frames that are "config owners". This is to prevent propagating a depth change of a child bay to its parent multi bay which should have a larger depth encompassing multiple child bays. Similar to the spread tools, this should be overridden if your product line does not use "real configs" so that dimension propagation continues to work for them.

public class MhBayRowEngineBehavior extends MhEngineBehavior {

    /**
     * Propagating filter.
     */
    extend public SnapperFilter propagatingFilter(MhSnapper noticer, str key) {
        // Make use of spread filter as well.
        SnapperFilter f = classificationFilter(noticer, key);
        MhAssortmentRefSnapperFilter assortmentFilter(noticer.assortmentRef);
        return MhCombinedFilter(assortmentFilter, MhCombinedOrFilter(rowFilter, f));
    }


    /**
     * Classification filter.
     */
    extend public SnapperFilter classificationFilter(MhSnapper noticer, str key) {
        if (key == "w") return noticer.isBay or noticer.parent.?isBay ? bayFilter : frameFilter;
        return MhCombinedFilter(mhConfigOwnerFilter, mhBayOrFrameFilter);
    }
}

Changes to spread tools switchChildren logic

In MhSnapperApplyAnimation, the method void switchChildren(Snapper oldSnapper, Snapper newSnapper) was typically used to retain the current child snappers of the snapper that is currently being applied to (retain oldSnapper.children). This is used for cases where we do not want to replace the child snappers with what was picked up (newSnapper.children).

Changes have been made to support being able to filter out specific child snappers so that they are always switched (so certain oldSnapper.children are always retained upon apply). A new method MhSnapperApplyAnimation.childrenFilter() has been introduced. Previously void switchChildren(Snapper oldSnapper, Snapper newSnapper) would always run its intended logic when executed and the conditional logic is usually checked before calling switchChildren(). We have now moved that logic down into switchChildren() itself so that every child can be specifically checked. If you have overridden switchChildren(Snapper oldSnapper, Snapper newSnapper) or switchSnapper(MhSnapper parent, Snapper oldSnapper, MhSnapper newSnapper), consider moving down any additional logic into switchSnapper().

As for how the childrenFilter() method works, any child snapper that is accepted by the filter will be affected by switchChildren() so those snappers in the pickedUp snapper will not be applied to the applied snapper, or those snappers in the applied snapper will be retained and not removed after the apply. This is useful for cases like certain child snappers should not affect a bay's configuration so the pickUpAndApply should ignore them.

public class MhSnapperApplyAnimation extends MhSnapperSpreadToolAnimation {

    New:
    /**
     * Alternative candidates filter.
     */
    extend public SnapperFilter childrenFilter() {
        return null;
    }


    /**
     * SwitchSnapper
     */
    extend public void switchSnapper(MhSnapper parent, Snapper oldSnapper, MhSnapper newSnapper) {
        ...
        Old: if (!includeChildren) switchChildren(oldSnapper, newSnapper);
        New: switchChildren(oldSnapper, newSnapper);
    }


    Old:
    /**
     * SwitchChildren
     */
    extend public void switchChildren(Snapper oldSnapper, Snapper newSnapper) {
        Snapper{} children = oldSnapper.children;
        
        //remove children from old
        for (child in children) {
            oldSnapper.removeChild(child);
            child.setParent(null);
        }

        //remove newSnappers children
        forChildren(child in newSnapper) {
            newSnapper.removeChild(child);
            child.setParent(null);
        }
        
        //add the old children to new snapper
        for (child in children) {
            child.setParent(newSnapper);
            newSnapper.addChild(child);
        }
    }


    New:
    /**
     * SwitchChildren
     */
    extend public void switchChildren(Snapper oldSnapper, Snapper newSnapper) {
        Snapper{} children = oldSnapper.children;

        SnapperFilter cFilter = childrenFilter;
        //remove children from old
        for (child in children) {
            if (!includeChildren or (cFilter and !cFilter.accepts(child))) {
                oldSnapper.removeChild(child);
                child.setParent(null);
            }
        }

        //remove newSnappers children
        forChildren(child in newSnapper) {
            if (!includeChildren or (cFilter and !cFilter.accepts(child))) {
                newSnapper.removeChild(child);
                child.setParent(null);
            }
        }
        
        //add the old children to new snapper
        for (child in children) {
            if (!includeChildren or (cFilter and !cFilter.accepts(child))) {
                child.setParent(newSnapper);
                newSnapper.addChild(child);
            }
        }
    }
}

There may still be a need to unconditionally execute switchChildren() which is no longer posssible due to the changes to the existing method. As such, we have temporarily introduced a new method void switchChildren(Snapper oldSnapper, Snapper newSnapper, bool forceSwitch) where if forceSwitch=true, will just execute the switchChildren() logic without conditional checks for each child. One such example is in MhLevelApplyAnimation.adjustLevelClassification(MhSnapper oldSnapper, MhSnapper newSnapper), when we are picking-up or applying a top beam that should not have child snappers, so this prevents applying unit load snappers to the top beam.

public class MhSnapperApplyAnimation extends MhSnapperSpreadToolAnimation {

    New:
    /**
     * Switch children.
     */
    extend public void switchChildren(Snapper oldSnapper, Snapper newSnapper,
                                      bool forceSwitch) {
        if (forceSwitch) {
            Snapper{} children = oldSnapper.children;

            //remove children from old
            for (child in children) {
                oldSnapper.removeChild(child);
                child.setParent(null);
            }

            //remove newSnappers children
            forChildren(child in newSnapper) {
                newSnapper.removeChild(child);
                child.setParent(null);
            }
        
            //add the old children to new snapper
            for (child in children) {
                child.setParent(newSnapper);
                newSnapper.addChild(child);
            }
        } else {
            switchChildren(oldSnapper, newSnapper);
        }
    }
}


public class MhLevelApplyAnimation extends MhSnapperApplyAnimation {

    /**
     * Adjust level classification.
     */
    extend public void adjustLevelClassification(MhSnapper oldSnapper, MhSnapper newSnapper) {
        ...
        if (oldSnapper.isTop) {
            newSnapper.classification += {sTop};
            switchChildren(oldSnapper, newSnapper, forceSwitch=true);
        } else if (newSnapper.isTop) {
            newSnapper.classification -= {sTop};
            switchChildren(oldSnapper, newSnapper, forceSwitch=true);
        }
    }
}

Improved support for connector snapping

MhSnapBehavior now also appends alternatives MhAttachSnapAlternative for each connector in the attach target.

public class MhSnapBehavior extends MhBehavior {

    /**
     * Append snap alternatives.
     */
    extend public void appendSnapAlternatives(Snapper snapper, SnapAlternative[] alternatives, Animation a, AnimationMouseInfo mi, SnapperFilter filter=null) {
        ...
        if (!spread) appendAttachSnapAlternatives(snapper, s, r.v1, alternatives, r.v2);
    }


    /**
     * Append attach snap alternative.
     */
    extend public void appendAttachSnapAlternatives(Snapper main, Snapper closest, point ip,
                                                    SnapAlternative[] alternatives, Double distanceToSnapper=null) {
        for (c in closest.?connectors()) alternatives << MhAttachSnapAlternative(c);
    }
}

For MhSnapperInsertToolAnimation, inserting using MhAttachSnapAlternative will now also try to snap the inserting snapper together with the alternative's snapper.

public class MhSnapperInsertToolAnimation extends MhSnapperSpreadToolAnimation {

    /**
     * StdInsert
     */
    public void stdInsert() {
        ...
                    if (alt as AttachSnapAlternative) {
                        beforeSnap(cMain, alt);
                        snapAllAligned({Snapper: cMain, alt.c.?snapper});
                        afterSnap(cMain, alt);
                    }
        ...
    }


    /**
     * Before snap.
     */
    extend public void beforeSnap(MhSnapper snapper, AttachSnapAlternative alt) { }


    /**
     * After snap.
     */
    extend public void afterSnap(MhSnapper snapper, AttachSnapAlternative alt) { }
}

MH animations now allows idle validation

The following classes now return true for the method bool allowIdleValidation(). This change was made so that graphics validation could still occur during animation for large drawings.

  • MhRowInsertToolAnimationG2
  • MhSnapperToolAnimationG2
  • MhDragAnimation
  • MhPropertyStretchAnimation

cm.abstract.ofdaXml

class OfdaXMLOrderLineProxy

With the addition of the new part attribute description/notes system, OfdaXMLOrderLineProxy now exports these values during OFDA XML exports.

The following function was added to do this. It is called from xmlLineItem(..) during a Parts export. It loops through the parts attributes to generate XML tags for them. The tags replicate those used in the Spec application's OFDA XML export.

/**
 * Generate the Part Attributes.
 */
extend public void xmlGeneratePartAttributes(str prefix, Part part, XmlStreamBuf buf) {
	for (attribute in part.?getAnnotations()) {
		xmlHead(prefix # "Comment", buf) {
			xmlItem(prefix # "Type", "Line Note");

			str value = concat(attribute.note, " : ", attribute.description);
			xmlItem(prefix # "Value", value);
		}
	}
}

cm.abstract.part

class ProdPartGridBuilder

Old → New Constructor

Old:

  • Simply assigned the provided env.
  • If env was null, the instance had no default environment.
Old:
public constructor(PartGridBuilderEnv env=null) {
    this.env = env;
}

New:

  • If no environment is passed, it now creates a default ProdPartGridBuilderEnv with buildTotalsRow = true.
  • Ensures a baseline configuration is always available, even without explicit input.
New:
public constructor(PartGridBuilderEnv env=null) {
    this.env = env ?? ProdPartGridBuilderEnv(buildTotalsRow=true);
}

class CustomSpecOption

See cm.abstract.part section in 16.5 New Features migration guide for new CustomSpecOption class documentation .

class AbsPart

Changed: extend public PartInfoTree createInfoTree(SpecOption option, PartInfoTree parent=null) {}

  • AbsPart now returns a SpecOptionInfoTree by default when generating info trees
extend public PartInfoTree createInfoTree(SpecOption option, PartInfoTree parent=null) {
Old:	return null;
New:	return SpecOptionInfoTree(this, option, parent=parent);
}

Old Pricing API

The following functions are now part of the old pricing system. They are still available for backwards compatibility (except basePrice which has been overloaded in core Part). Migration to the new pricing API should happen as soon as possible. The new pricing API is introduced in v16.5 and documented in the cm.core.part.Part documentation.

public double customListPrice(bool includeChildren=false, str currency=null, Space space=null) {}
extend public double specialListPrice(double listPrice) {}
extend public Double baseOptionPrice() {}
extend public Double specialOptionPrice() {}
extend public double optionSpecialUpcharge() {}
extend public Double upcharge() {}

Old: extend public double basePrice() {}
New: extend public double basePrice(bool includeChildren=false, Space space=null, bool translatePrice=true) {}

class AbsBasePricePartColumn

Changed: public Object value(Part part, Space space) {}

The AbsBasePricePartColumn value now calls the new basePrice(..) function on core Part.

Old → New behavior

Old:

  • Checked if part was an AbsPart
  • Returned part.basePrice() if so
  • Returned null if not

New:

  • Returns new basePrice(..) function value directly from core Part

class AbsUpchargePartColumn

Changed: public Object value(Part part, Space space) {}

The AbsUpchargePartColumn value now calls the new optionPriceSum(..) function on core Part.

Old → New behavior

Old:

  • Checked if part was an AbsPart
  • Returned part.upcharge() if so
  • Returned null if not

New:

  • Returns new optionPriceSum(..) function value directly from core Part

class SpecOptionInfoTreeColumn

Changed: public GridCell gridCell(PartInfoTree item, Space space, symbol view=null) {}

Old → New behavior

Old:

  • If there is no value for the column, returns null
  • Otherwise, returns a NameGridCell with the value

New:

  • If there is no value for the column, returns null
  • If the item is a SpecOptionInfoTree, returns a SpecOptionNameGridCell with the items associated value, part, and option
  • Otherwise, returns a NameGridCell with the value
public GridCell gridCell(PartInfoTree item, Space space, symbol view=null) {
	str value = output(item, space);
	if (value.empty()) return null;
	
New:	if (item as SpecOptionInfoTree) {
New:		return SpecOptionNameGridCell(value, item.part, item.specOption, align=left);
New:	}

	return NameGridCell(value, left);
}

class CustomOptionSpecial

See cm.abstract.part section in 16.5 New Features migration guide for new CustomOptionSpecial class documentation .

class SpecOptionInfoTree

Changed: public PartColumn[] columns() {}

Old → New behavior

Old:

  • If _columns field was set, its value was returned
  • Otherwise, super() was returned (which is null)
Old:
public PartColumn[] columns() {
	return _columns ?? super();
}

New:

  • If _columns field was set, its value was returned
  • Otherwise, returns a default set of SpecOption columns
    • specOptionInfoColumn (option code)
    • specOptionDescColumn (option description)
    • specOptionUpchargeColumn (option price)
New:
public PartColumn[] columns() {
	return _columns ?? [PartColumn: specOptionInfoColumn,
						specOptionDescColumn,
						specOptionUpchargeColumn];
}

class ProdPart

Constructor Migration: List Price → Base Price + Option Price Sum

The ProdPart class constructors have been expanded and split to support the new part pricing system (introduced in 16.5). New constructors now accept basePrice and optionPriceSum separately.

Old constructors that use list price remain available but are marked for deprecation in a future version.

Old Constructor
  • constructor(Snapper snapper, str articleCode, str description, double listPrice, …)
  • This constructor uses list price (a single cached price) instead of separating base + options.
  • Still supported in 16.5 for compatibility.
New Constructors (preferred, introduced in 16.5)
  • constructor(Snapper snapper, str articleCode, str description, double basePrice, Double optionPriceSum, …)
  • This constructor uses separate base price and option prices instead of utilizing a single cached list price
  • Preferred in v16.5+
Impact
  • If you use list price constructors today → update to the new basePrice + optionPriceSum pattern
  • See new pricing API documentation in cm.core.part.Part compile-time section for more migration tips

Added: public Double generateOptionPriceSum() {}

Introduces a new method to compute the total option price, explicitly aggregating all SpecOption upcharges, including specials.

Behavior
  • Before:
    • No direct method existed for calculating the total option price.
    • Special handling was inconsistent and often spread across different code paths.
  • Now:
    • Provides a single method that:
      • Iterates through all specOptions().
      • Calls each option’s upcharge(this) for contextual pricing.
      • Returns the summed total as a Double.
Impact
  • Centralizes option price calculation logic.
  • Ensures specials are accounted for in a standardized way.
  • Reduces duplication across pricing code paths.
  • Improves clarity: developers can call one method to retrieve the full option pricing.
  • If you have custom option price logic, override generateOptionPriceSum() in your extended Part class.
  • Invalidate the cache (invalidateOptionPriceSum()) when option state changes to trigger regeneration.

Added: extend public void invalidateSpecOptions(bool invalidateOptionPriceSum=true) {}

The invalidateSpecOptions method is introduced alongside the new SpecOptions caching mechanism.

  • Before: SpecOptions sequence was always rebuilt when accessed.
  • Now: SpecOptions are cached for performance reasons, and this method allows developers to explicitly invalidate (reset) the cache.
  • It also optionally invalidates the cached option price sum, ensuring related derived data stays in sync.
Behavior
  • Sets _specOptions to null, clearing the cache so the sequence will be recomputed on next access.
  • If invalidateOptionPriceSum is true (default), also clears the cached option price sum.
Impact
  • New responsibility for developers:
    • Since SpecOptions are now cached, any change to underlying data that affects them must be followed by a call to invalidateSpecOptions() to prevent stale values
  • Performance improvement:
    • Accessing SpecOptions is now faster due to caching
    • Rebuild happens only when invalidated (see rebuildSpecOptions documentation)
  • Backward compatibility:
    • Code that relied on automatic rebuild will now see cached values
    • Developers must add explicit invalidation calls in update flows where rebuild is required
  • Migration requirement:
    • Review any code paths where SpecOptions can change (e.g., product configuration updates).
    • Insert calls to invalidateSpecOptions() in those paths to ensure cache consistency.
    • If option price sums are affected by the same changes, let the default true flag handle both invalidations. Otherwise, explicitly pass false.

Changed: extend public void appendSpecOptions(SpecOption[] newOptions) {} and extend public void appendSpecOption(SpecOption newOption) {}

Both appendSpecOptions and appendSpecOption now accept a new boolean parameter invalidateOptionPrice (default: true). This works with the new option price caching mechanism by allowing the system to selectively invalidate the cached option price sum when spec options are modified.

Old: extend public void appendSpecOptions(SpecOption[] newOptions) {}
New: extend public void appendSpecOptions(SpecOption[] newOptions, bool invalidateOptionPrice=true) {}

Old: extend public void appendSpecOption(SpecOption newOption) {}
New: extend public void appendSpecOption(SpecOption newOption, bool invalidateOptionPrice=true) {}
Old → New behavior

Old:

  • Option prices were not cached.
  • Every time option prices were accessed, they were recalculated on the fly based on current spec options.
  • No invalidation step was needed.

New:

  • Option price totals are now cached
  • When spec options are modified, invalidateOptionPriceSum() is triggered to ensure the cache stays correct
  • Developers can pass invalidateOptionPrice=false to skip cache invalidation if they plan to manage it manually or delay recalculation.
Impact
  • Performance improvement: frequent option price sum lookups no longer require full recalculation
  • Cache management: introduces the concept of invalidating/regenerating option price sums as options change.
  • Default safety: with the default true, cache stays consistent automatically — existing usage behaves as expected
  • Advanced optimization: developers can set false during bulk option appends/updates, then explicitly trigger invalidation once, avoiding multiple regenerations.
  • Migration note: developers should be aware that option pricing is no longer computed “live” — results are now cache-backed.

Cache SpecOption Changes

With the introduction of custom options in the query dialog, the following changes were made in ProdPart:

  • specOptions() now inserts custom options
    • Inserted at value of CustomSpecOptions sequence value
    • Inserts to end if sequence is -1 (default for CustomSpecOption)
  • Introduced nonCustomSpecOptions()
    • Provides all SpecOptions except CustomSpecOptions
    • Filters out any CustomSpecOption instances while collecting
  • Introduced customSpecOptions()
    • Provides all CustomSpecOptions only.
    • Uses part specials key + PartSpecialHolder lookup to gather user-defined options.
  • Added caching for SpecOptions
    • New field private SpecOption[] _specOptions : stream=null
    • Purpose: cache collects spec options to avoid repeated recollection and insertion
    • Must be invalidated when _partOptions changes
  • specOptions() now cached
    • Old: dynamically built a fresh list of options every call.
    • New: checks _specOptions, rebuilds only if null, otherwise returns cached.
  • Introduced rebuildSpecOptions()
    • Centralizes SpecOption sequence rebuilding
    • Ensures both built-in options and dynamic custom ones are aggregated in a single place
Impact
  • Performance: caching improves efficiency when parts/options are queried frequently
  • Extensibility: system now supports user-defined freeform options (CustomSpecOptions) in addition to standard ones
Interfaces
Added: private SpecOption[] _specOptions : stream=null;
Added: final public SpecOption[] nonCustomSpecOptions() {}
Added: extend public void insertCustomOptions(SpecOption[] ops) {}
Added: extend public SpecOption[] rebuildSpecOptions() {}
Added: extend public void invalidateSpecOptions() {}
Added: extend public CustomSpecOption[] customSpecOptions() {}
Added: extend public CustomOptionSpecial[] getCustomOptionSpecials(PropObj s=null) {}

Exporting Part Attributes via New Interface

With the addition of the new Attribute Note and Description columns in the Calculations dialog, the following changes have been made to ProdPart:

  • Overrode new partToOwnerKey function
    • Uniquely identifies a part to it's owner
      • Ex. table legs with a table top owner could have part-to-owner keys like "leg0", "leg1", etc.
    • Behavior:
      • returns the partSourceID value appended to the super() value
  • Introduced generateSifAnnotationRows function
    • Happens during Configura SIF exports
    • Behavior:
      • loops through Parts PartAnnotations
      • adds SIF lines for each PartAnnotation
        • "AN" for the PartAnnotations note value
        • "AD" for the PartAnnotations description value
  • Introduced generateAttributeData function
    • Happens during PMX exports
    • Behavior:
      • loops through Parts PartAnnotations
      • generates AttributeData objects for each PartAnnotation
      • adds the AttributeData objects to the ItemDatas attributes sequence
  • Introduced initializeAnnotationsFromItemData
    • Happens during PMX imports
    • Behavior:
      • loops through an ItemDatas attributes sequence
      • generates PartAnnotation objects from the AttributeDatas
      • adds the PartAnnotationobjects to thePart`s annotations
// Part-to-Owner key
New: public str partToOwnerKey() {}

// SIF
New: extend public void generateSifAnnotationRows(str[] lines) {}

// PMX
New: extend public void generateAttributeData(ItemData itemData) {}

//PMX Import
New: extend public void initializeAnnotationsFromItemData(ItemData item, ProjectInformation projectInfo) {}

class SpecOptionUpchargeInfoTreeColumn

A new SpecOptionUpchargeInfoTreeColumn has been added to display price values associated with SpecOptions in a PartInfoTree

  • Provides formatting and display logic for the price of each option.
  • Defaults to being hidden in the UI (initialVisibility = #none).
  • Uses a SpecOptionNameGridCell

cm.abstract.part.query

class OptionMakeSpecialDialog

Added: public PartSpecial generateSpecial() {}

The helper method generateSpecial() has been overridden to streamline the process of creating OptionSpecial objects from dialog input.

Behavior
  • If original special was of the OptionSpecial type, calls and returns generateOptionSpecial value
  • Otherwise, returns the super() value

Added: extend public OptionSpecial generateOptionSpecial(OptionSpecial original) {}

The helper method generateOptionSpecial() has been created to create OptionSpecial objects from dialog input.

Behavior
  • If original special was of the CustomOptionSpecial type, creates and returns a CustomOptionSpecial made from the dialogs input values
  • Otherwise, returns an OptionSpecial given the dialogs input values

class QueryOptionRowData

In 16.5, the ProdPartQueryDialogDataEnv has changed it's backing data structures, replacing the str->Part parts, int->str rowIDs, and str->str{} options maps with a single QueryRowData[] queryRows data sequence. As a result, the subclass QueryOptionRowData has been created to represent option rows in the query dialog.

  • Encapsulates a SpecOption and it's parent Part
  • Handles manipulation of the SpecOptions special on the owning Part
  • Contains a new field to track the options parent row (public QueryRowData parent;).

Interface

/**
 * QueryOptionRowData
 * 
 * This class is responsible for managing 
 * data for a SpecOption row in a QueryDialog.
 */
public class QueryOptionRowData extends QueryRowData {

    /**
     * Parent QueryRowData object.
     */
    public QueryRowData parent : copy=reference;

    /**
     * Constructor.
     * @id ID for this row
     * @data The data object to associate with this row
     */
    public constructor(str id, Object data, QueryRowData parent=null) { ... }

    /**
     * SpecOption option associated with this row.
     * @return The SpecOption object associated with this row.
     */
    extend public SpecOption option() { ... }

    /**
     * Parent Part to this row.
     * @recurse optional flag to recurse tree to parent Part
     * @return The Part object associated with this row's parent.
     */
    extend public Part parentPart(bool recurse=false) { ... }

    /**
     * Parent SpecOption to this row.
     * @return The SpecOption object associated with this row's parent.a
     */
    extend public SpecOption parentOption() { ... }

    /**
     * Get the special associated with this row.
     * Override to get the specific special handling logic.
     * @return The PartSpecial object associated with this row
     */
    public PartSpecial getSpecial() { ... }

    /**
     * Assign a special to this row.
     * Override to get the specific special handling logic.
     * @special The PartSpecial object to associate with this row
     */
    public void putSpecial(PartSpecial special) { ... }
    
    /**
     * Remove the special from this row.
     * Override to get the specific special handling logic.
     */
    public void removeSpecial() { ... }
}

class ProdPartQueryControlWindow

New Add Option Button

With the addition of the new "Add Option" feature in the query dialog, a new override of the QueryControlWindow has been added. It contains an additional button (addOptionButton) for the new adding custom options feature.

public class ProdPartQueryControlWindow extends QueryControlWindow {
    
    /**
     * Add custom option button.
     */
    public QueryButton addOptionButton;
    
       
    /**
     * Initialize controls.
     */
    public void initControls() { ... }
    
    
    /**
     * Align controls.
     */
    public void alignControls() { ... }
}

class QueryProdPartRowData

In 16.5, the ProdPartQueryDialogDataEnv has changed it's backing data structures, replacing the str->Part parts, int->str rowIDs, and str->str{} options maps with a single QueryRowData[] queryRows data sequence. As a result, the subclass QueryProdPartRowData has been created to represent ProdPart rows in the query dialog.

  • Only overridden to custom handle putSpecial:
    • Allows CustomOptionSpecials to be created when a ProdPart row is selected in the query dialog

Interface

/**
 * QueryProdPartRowData
 * 
 * This class is responsible for managing 
 * data for a ProdPart row in a QueryDialog.
 */
public class QueryProdPartRowData extends QueryPartRowData {

    /**
     * Put a special to this row.
     * @special The PartSpecial object to put
     */
    public void putSpecial(PartSpecial special) {
        if (special as CustomOptionSpecial) {
            if (data as ProdPart) {
                data.putOptSpecial(special.option(), special);
            }
        } else {
            super(..);
        }
    }
}

cm.abstract.pmx

class ItemData

As of 16.5, a new interface for lead time and PartAnnotations have been added to core Part. These values are now exported with PMX exports leading to the following additions in ItemData.

In cm/abstract/pmx/itemData.cm

New: public AttributeData[] attributes;

/**
 * Instantiate ItemData (this) fields from Part.
 */
extend public void generateItemDataFromPart(Part part) {
	...
New:	this.leadtime = part.leadTime;

	if (part as ProdPart) {
		...
New: 	part.generateAttributeData(this);
		...
	}

	...
}

cm.abstract.projectInfo

class ProjectInformationDialog

Due to an issue where Project Information fields were saving in cases where the user did not click "OK" (dialog close, field editing, etc), the following changes have been made in ProjectInformationDialog.

Changed: private bool saveInfo;

  • The default value has changed to false for the saveInfo field

Added: extend public void updateDependent(str key, str depKey, Object value, bool update=true) {}

  • New bool update (default: true) parameter
  • Allows control over updating project information through dependent controls
  • Solves issue where dependent controls are updating project information by default even if top level control is not updated

Changed: extend public void textContentChanged(Control c, bool update=true) {}

  • Now calls new updateDependent function, passing in the update parameter
/**
 * Text content changed.
 */
extend public void textContentChanged(Control c, bool update=true) {
	...
	
Old:	for (depKey in dependentKeys(key)) updateDependent(key, depKey, val);
New:	for (depKey in dependentKeys(key)) updateDependent(key, depKey, val, update=update);
}

Changed: extend public void enableSelected(Control control, bool update=true) {}

  • Now calls new updateDependent function, passing in the update parameter
/**
 * Check box changed.
 * To be done in child class.
 */
extend public void enableSelected(Control control, bool update=true) {
	if (!world or !control.visible) return;
	if (control as CheckBox) {
		...
		
Old:	for (depKey in dependentKeys(key)) updateDependent(key, depKey, val);
New:	for (depKey in dependentKeys(key)) updateDependent(key, depKey, val, update);
	} else {
		...
	}
}

Changed: extend public void applyAndClose() {}

  • Now sets saveInfo back to default false value after close

Added: public bool keyEsc() {}

  • Overridden to handle saving on escape-click
  • Sets saveInfo to false before calling super()

Changed: extend public FormattedTextField appendFieldCombo(..) {}

Text fields created in this function (FormattedTextField) now set the enterKeyCallback parameter to contentChangedCB rather than applyCB

Old → New behavior

Old:

  • FormattedTextFields used applyCB as their enter-key callback
  • applyCB called window.apply(), automatically applying changes to the world cached project information object

New

  • FormattedTextFields now use contentChangedCB as their enter-key callback
  • Applies changes visually without applying them to the world cached project information object
Impact
  • The ProjectInformationDialog should now only update the world cached ProjectInformation when the user selects "OK" in the dialog

Changed: extend public DateField appendDateFieldCombo(..) {}

Date fields created in this function (DateField) now set the callback parameter to contentChangedCB rather than applyCB

Old → New behavior

Old:

  • DateFields used applyCB as their callback
  • applyCB called window.apply(), automatically applying changes to the world cached project information object

New

  • DateFields now use contentChangedCB as their callback
  • Applies changes visually without applying them to the world cached project information object
Impact
  • The ProjectInformationDialog should now only update the world cached ProjectInformation when the user selects "OK" in the dialog

Changed: private void contentChangedCB(Control control) {}

  • Now calls window.textContentChanged() with update parameter set to false
Old → New behavior

Old:

  • Called window.textContentChanged with update parameter set to default (true)
  • Dialog controls using the contentChangedCB callback would automatically update the world cached project information

New:

  • Calls window.textContentChanged with update parameter set to false
  • Dialog controls using the contentChangedCB callback do not update world project information automatically
Impact
  • The ProjectInformationDialog should now only update the world cached ProjectInformation when the user selects "OK" in the dialog
/**
 * Text area content changed callback
 */
private void contentChangedCB(Control control) {
    Window window = control.parentFrame;
    if (window as ProjectInformationDialog and control.visible) {
Old:		window.textContentChanged(control);
New:		window.textContentChanged(control, update=false);

    }
}

Changed: private void checkBoxContentChangedCB(Control control) {}

Now calls window.enableSelected() with update parameter set to false

Old → New behavior

Old:

  • Called window.enableSelected with update parameter set to default (true)
  • Dialog controls using the checkBoxContentChangedCB callback would automatically update the world cached project information

New:

  • Calls window.enableSelected with update parameter set to false
  • Dialog controls using the checkBoxContentChangedCB callback do not update world project information automatically
Impact
  • The ProjectInformationDialog should now only update the world cached ProjectInformation when the user selects "OK" in the dialog
/**
 * Check Box content changed callback.
 */
private void checkBoxContentChangedCB(Control c) {
    Window window = c.parentFrame;
    if (window as ProjectInformationDialog and c.validAndVisible) {
Old:		window.enableSelected(c);
New:		window.enableSelected(c, update=false);
    }
}

cm.core

cm.core

Session removing world

When removing a World using removeWorld(World) which is not the main, main will result in being nulled. It should only be nulled if the World being removed is main. This ensures that calling mainWorld() would not be null (or select another world) when you are calling mainWorld during beforeSelectWorldHook, selectWorldHook, removeWorldHook.

Space changeToSpace for snappers

hamt_snapper_insert() is called earlier in changeToSpace() to match the put method. If you have overriden changeToSpace() in your snapper to check if xsnapper is in the Space's snappers_hamt, it will now successfully find it in snappers_hamt where it could previously fail.

Old:
    extend public void changeToSpace(Snapper xsnapper, bool putInBsp=false) {
        ...
        snappers << xsnapper;
        xsnapper.changeToSpace(this);  // changeToSpace gets called before insert to hamt
        xsnapper.space = this;
        holders << xsnapper.holder;

        catchAndReportErrors("Space HAMT insert due to changeToSpace") {
            hamt_snapper_insert(xsnapper, "changed to space", snappers);
        }
        ...
    }

New:
    extend public void changeToSpace(Snapper xsnapper, bool putInBsp=false) {
        ...
        catchAndReportErrors("Space HAMT insert due to changeToSpace") {
            hamt_snapper_insert(xsnapper, "changed to space", snappers);
        }

        snappers << xsnapper;
        xsnapper.changeToSpace(this); // changeToSpace gets called after insert to hamt
        xsnapper.space = this;
        holders << xsnapper.holder;
        ...
    }

Space hamt_snapper_insert

In previous versions, hamt_snapper_insert() method previously evicts an existing Snapper if an existing snapper with the same guid key exists, then prints out a collision report. In 16.5, if a different Snapper is inserted into the hamt with a non-unique guid, a new guid is assigned to the newly inserted Snapper first, prints out a collision report. Followed by inserting the modified snapper into Space.snappers_hamt.

class Animation

Added: extend public WindowView currentView() {

Sometimes tool animations (ToolAnimationG2) would get the incorrect view. This has been resolved by replacing uses of activeView with currentView.

Copy

The original snappers being copied (e.g. by ctrl+c) no longer receive calls to pickedUp(), dropped() and snapAllAligned(). The reason for this change is to avoid issues where the original snappers were unexpectedly modified.

InsertAnimationG2 and DragAnimationG2

InsertAnimationG2 and DragAnimationG2 has been adjusted to avoid trySnap() from being inadvertently called twice within the same action to improve performance.

Session

Starting from 16.5 Major, we are changing the default argument selectWorldIfNull from true to false. This is to prevent cases where calling mainSpace() or mainWorld() can inadvertently mess up the currently selected world, especially when called by various world or space hooks. We encourage you to review existing usage of mainWorld() and mainSpace() to clarify the desired behavior.

Old: final public World mainWorld(bool selectWorldIfNull=true) {
New: final public World mainWorld(bool selectWorldIfNull=false) {

Old: final public Space mainSpace(bool selectWorldIfNull=true) {
New: final public Space mainSpace(bool selectWorldIfNull=false) {

class InputCoreProperty

We have made changes in method void appendControls(Control[] list) when generating a CoreDistanceField so that the measureEndCallback function for this control works with property owners that are not Snapper, Animation, or Vessel.

This sub-function now distinguishes between the owner of the property (which can be any PreCorePropObj), and the owner of the CoreProperties object. Now it can successfully put a new property value into the property owner without needing to cast it to Snapper, Animation, or Vessel. Note that in this case, the owner of the CoreProperties still needs to be a Snapper.

One additional difference is that if the property owner is a Snapper, the callback Snapper.quickPropertyChanged(str key, Object value, Object oldValue) will still be called as it previously was. However if the property owner is not a Snapper, the callback CorePropObj.userPropertyChanged(str key, Object current, Object oldValue, CoreProperties properties) will be called instead.

public class InputCoreProperty extends CoreProperty {

    /**
     * Append controls.
     */
    public void appendControls(Control[] list) {
        ...
        <CorePropObj, PreCorePropObj, str> prop;
        if (?prop = env) {
            ...
            Object propertiesOwner = prop.v0;
            if (?Snapper z = propertiesOwner) {
                ...
                prop.v1.put(prop.v2, nw);

                if (prop.v1 == z) {
                    z.quickPropertyChanged(prop.v2, nw, old);
                } else if (prop.v1 in CorePropObj) {
                    prop.v1.CorePropObj.userPropertyChanged(prop.v2, nw, old, null);
                }
                ...
    }
}

Constructor Migration: List Price → Base Price + Option Price Sum

In v16.5, new constructors have been introduced for the above Part classes to support the new pricing model. Previously, these Parts accepted a cached list price (listPrice) directly as a parameter. This behavior is now being phased out.

Old Constructors

  • constructor(Snapper snapper, str articleCode, str description, double listPrice, ...)
  • Accepts a total listPrice value to cache.
  • See documentation in compile-time section for cm.core.part.Part for more info

New Constructor (preferred, introduced in 16.5)

  • constructor(Snapper snapper, str articleCode, str description, double basePrice, Double optionPriceSum, ...)
  • Accepts basePrice and optionPriceSum separately for caching.
  • See documentation in compile-time section for cm.core.part.Part for more info

Impact

  • Migrate to new constructor and split your values into basePrice and optionPriceSum.
  • All new core features and pricing rules will rely on the new constructor/pricing system.
  • The old constructor remains for backward compatibility

cm.core.calc

articleView.cm

The scope of the field additionalAdjustments has been changed, calling additionalAdjustments will instead return a deep copy of the array.

Old: package AdditionalGlobalPartAdjustment[] additionalAdjustments : public readable;
New: package AdditionalGlobalPartAdjustment[] _additionalAdjustments;

The following functions have been added to allow easier manipulation of the additional adjustments of an article view:

Added: final public AdditionalGlobalPartAdjustment[] additionalAdjustments()
Added: extend public void appendAdditionalAdjustments(AdditionalGlobalPartAdjustment[] adjustments)
Added: final public void clearAdditionalAdjustments()

For reference the other function to manipulate additional adjustments are:

extend public AdditionalGlobalPartAdjustment getAdditionalAdjustment(str key)
extend public void addAdditionalAdjustment(AdditionalGlobalPartAdjustment adjustment)
extend public void putAdditionalAdjustments(AdditionalGlobalPartAdjustment[] adjustments)
extend public void removeAdditionalAdjustment(AdditionalGlobalPartAdjustment adjustment)

class DrawingSettingsControlPanelPage

A new control panel page has been added titled Drawing Settings. As of 16.5, it only contains one setting for toggling article code display for Ind Tags in 2D/3D views. It's purpose is to hold settings that pertain to the drawing and are not user settings. A user setting, for example, would be the language setting that does not pertain to a single drawing but will persist across all user drawings.

The new DrawingSettingsControlPanelPage is registered during initialization of the cm.core.calc package in init.cm.

cm.core.calc.test.orderExport

class BaseCalcInfoPrinter

The printInfoTree function has been updated to print BasicPartInfoTreeColumns.

final package void printInfoTree(Part part, PartInfoTree info, PartListRow row, PartColumn[] viewColumns, int n=0) {
	...
	for (column in viewColumns, index=col) {
		for (col in info.columns) {
			if (col.eq(column)) {
				str output;
				
				if (col as PartInfoColumn) {
					...
New:			} else if (col as BasicPartInfoTreeColumn) {
New:				output = col.output(info, mainSpace());
				} else if (col as BasicPartColumn) {
					...
				}

				...
			}
		}
	}
	...
}

cm.core.collabG3

cm/core/realtime.cm

RTInvalidate calls that were invoked before the RT runtime is initialized are now deferred and will be invoked when the runtime is ready later. Previously, attempts that were made to invalidate certain CollabPro realtime synchronized data before RT runtime is ready will be lost, resulting in data inconsistencies.

See also related changes in cm.network.cbb.

cm.core.dwg

class CapPart

Constructor Migration: List Price → Base Price + Option Price Sum

A new constructor has been introduced for creating parts that takes basePrice and optionPriceSum directly. The old constructor that takes a single listPrice.

Old → New behavior

Old:

  • Constructor accepted a single listPrice along with articleCode, description, company, and catalog.
  • The list price combined both base price and option pricing into one value.
  • No separation between core part value and option upcharges.

New:

  • A new constructor separates basePrice (core part price) and optionPriceSum (sum of option prices).
  • Old listPrice constructor remains available but is annotated as deprecated
Impact
  • Modern pricing system alignment: Supports the new pricing model introduced in 16.5, where listPrice is derived from basePrice + optionPriceSum.
  • Clearer semantics: Separating base and option prices enables more accurate pricing breakdowns and better handling of specials/discounts.
  • Migration required:
    • Code currently using the listPrice constructor should migrate to the basePrice + optionPriceSum version.
  • Backward compatibility: Both constructors exist for now, ensuring older code compiles, but new development should adopt the new signature.

cm.core.geometry2D.advanced

public int insideCount(point2D dp, vector2D direction, double r=0) { is used to determine whether a point2D lies inside or outside the shape. Previously it would in rare cases indicate that it was inside while clearly outside and vise versa. It would also not return consistent results when the point was on the edge of the shape.

For example, a pyramid-shaped triangle with its tip pointing to the right would consider a point one meter to the right of its tip to be inside of the triangle. This is no longer the case.

This change is not likely to cause issues in common use cases. However, it can be good to smoke test functionality that heavily relies on APath2D or its derivatives.

cm.core.itemTag

class ItemTag

The invalidate(..) function has been updated to call info.?invalidate().

/**
 * Invalide the tag info.
 */
public void invalidate(dirty2D flag) {
New:	info.?invalidate();
	if (owner and owner.space) {
		space.invalidate(this, flag);
	}
}

A number of functions have been moved from the itemTag.cm file to the more appropriate functions.cm and hooks.cm files. These are the moved functions:

// Moved to functions.cm
public void enableItemTagsAlwaysUpdate(bool on) {}
public bool itemTagsAlwaysUpdateEnabled() {}
public void removeItemTags(Snapper this) {}

// Moved to hooks.cm
public bool updateWorldItemTags(World world, bool validate, PriceChangeEnv env) {}
public bool updateSpaceItemTags(Space space, bool validate, function():bool interrupt, bool force) {}
public void updateSpaceItemTags(Space space) {}

class ItemTagInfo

The buildGraph() function has changed to build the text based on the new setting value (explained in the ItemTagInfo compile-time section). It now calls getTagText() where it used to just get the tagText field:

NOTE: Any overrides of this function should utilize the new getTagText() function.

/**
 * Build the graph in local coordinates.
 */
extend public void buildGraph() {
	if (tStyle) {
		GText t = GText((0, 0), getTagText(), middle, tStyle);
		graphCache = t;
	} else {
		graphCache = GText((0, 0), getTagText(), middle, h=textHeight(), alwaysReadable=true);
	}
}

cm.core.part

Invisible Pricing Propagation Behavior

The following functions were added or modified in cm/core/part/parts.cm in v16.5. These functions were modified in support of the new pricing model which is documented in the compile-time section for cm.core.part.Part.

Changed: private void propagatePrice(Part p) {}
Added: private void propagatePriceNew(Part parent) {}

Changed: private void propagatePrice(Part p)

With the introduction of the new pricing system, the behavior of propagatePrice in cm/core/part/parts.cm has undergone changes.

Old → New behavior

Old:

  • Propagation used cached listPrice only.
  • When a child Part had invisiblePricing() == true:
    • Its totalListPrice() was divided by the parent’s quantity and added to the parent’s list price.
    • The child’s listPrice was set to 0.
    • Currency conversion was handled manually during this aggregation.

NEW:

  • propagatePrice now branches on the parent’s pricing model:
    • If the parent uses new pricing:
      • propagatePriceNew(..) is called
  • NOTE: Child parts are assumed to be utilizing the same pricing model as their parent Part

Added: private void propagatePriceNew(Part parent) {}

If the parent Part has useNewPricing() set to true, the new propagation system is utilized on the parent and child Parts. With the new pricing model, invisible pricing propagation is split into two: base price and option price sum.

Old → New behavior

Old:

  • Propagation is done in propagatePrice(..) and utilizes cached listPrice only.

NEW:

  • propagatePrice now branches on the parent’s pricing model:
    • If the parent uses new pricing:
      • Propagation is split into two dimensions:
        • Base price (totalBasePrice)
        • Option price sum (totalOptionPriceSum)
      • Each is separately aggregated from invisible children and divided by the parent’s quantity
      • Child data values are cleared
      • The parent’s cached data values are incremented accordingly
      • Currency conversion is no longer done here
        • Price getters now have translatePrice flag which is set to false during aggregation
  • NOTE: Child parts are assumed to be utilizing the same pricing model as their parent Part

class PartSpecial

Added: extend public void copy(PartSpecial special) {}

  • Allows for copying values from one PartSpecial instance to another
Behavior
  • Sets values on this to values from passed in special
  • Fields transferred:
    • str partNum
    • str descr
    • bool priceReplace
    • double amount

class PartGridBuilder

Constructor Change

Old → New behavior

Old:

  • Simply assigned the provided env.
  • If env was null, the instance had no default environment.
Old:
public constructor(PartGridBuilderEnv env=null) {
    this.env = env;
}

New:

  • If no environment is passed, it now creates a default PartGridBuilderEnv with buildTotalsRow = true.
  • Ensures a baseline configuration is always available, even without explicit input.
New:
public constructor(PartGridBuilderEnv env=null) {
    this.env = env ?? PartGridBuilderEnv(buildTotalsRow:true);
}

Added: extend public void populateGridWindow(Object data, GridWindow grid, PartGridBuilderEnv env=null) {}

  • High-level entry point to populate a GridWindow with arbitrary data.
Behavior
  • If no grid is provided → safely returns
  • If no env is passed → falls back to cached `this.env
  • Calls two helpers:
    • populateColumns(grid, env)
    • populateRows(data, grid, env)
  • Net effect: Wraps the column + row population into a single call.

Added: extend public void populateRows(Object data, GridWindow grid, PartGridBuilderEnv env=null)

  • Populates rows in a GridWindow from different types of input collections.
Behavior
  • If no grid → safely returns.
  • Falls back to cached this.env if no env is given.
  • Supports two input types:
    • Seq : Iterates and calls populateRow(obj, grid, env) for each.
    • Set: Same iteration and per-object row population.
  • Skips null objects
  • If env.buildTotalsRow == true, appends a totals row after populating all others.

class Part

Modified Pricing Behavior (v16.5 and later)

The following functions were modified with the introduction of the new pricing system (documented in cm.core.part.Part compile-time section).

Changed: final public double listPrice(bool includeChildren=false, Space space=null) {}
Changed: final public double listPrice(..)
Old → New behavior

Old:

  • If applicable, returns list price adjusted value
  • Otherwise, returns customListPrice(..)

New:

  • If applicable, returns list price adjusted value
  • Otherwise, checks useNewPricing() to determine pricing behavior
    • Returns calculatedListPrice(..) when useNewPricing is true
    • Returns customListPrice(..) when useNewPricing is false
Impact
  • See new pricing API documentation in cm.core.part.Part compile-time section for migration tips

Modified PartSpecials Behavior (v16.5 and later)

Retrieval and modification of PartSpecials on Part has been updated to account for flattened parts and to allow optional invalidation of world price.

Added: extend public PartSpecial getSpecial(str id, PropObj s=null) {}
Old → New behavior

Old:

  • Only supported fetching a PartSpecial using the implicit specialsKey().

New:

  • Adds an overload to get a special by an explicit id.
  • If no id is provided (empty string), it safely returns null.
  • Broadens lookup options: you can now fetch by specialsKey() or a direct identifier.
Changed: extend public bool containsSpecial(PropObj s=null) {}
Old → New behavior

Old:

  • Checked only the current owner for a special by calling getSpecial(s)

New:

  • Still checks the current owner
  • Additionally iterates through all owners, returning true if any owner has a special.
  • Result: containsSpecial now considers both self and inherited/related owners instead of just one.
Changed: putSpecial functions
Old: extend public void putSpecial(PartSpecial special, PropObj s=null) {}
New: extend public void putSpecial(PartSpecial special, PropObj s=null, bool invalidateWorldPrice=true) {}
New: extend public void putSpecial(str id, PartSpecial special, PropObj s=null, bool invalidateWorldPrice=true) {} 
Old → New behavior

Old:

  • Simple: placed a PartSpecial in the current owner’s PartSpecialHolder keyed by specialsKey()
  • Always invalidated world price.

New:

  • Signature extended with bool invalidateWorldPrice = true
  • Now supports two ways of saving:
    • If the passed in PropObj s=null parameter is not null → s.putSpecial(...)
    • Otherwise → iterates over all owners and updates them.
  • Actively propagates invalidateWorldPrice flag.
  • Ensures consistency across multiple owners, not just the direct one.
Changed: removeSpecial functions
Old: extend public void removeSpecial(PropObj s=null) {}
New: extend public void removeSpecial( PropObj s=null, bool invalidateWorldPrice=true) {}
New: extend public void removeSpecial(str id, PropObj s=null, bool invalidateWorldPrice=true) {
Old → New behavior

Old:

  • Removed a special only from the current owner using specialsKey()
  • Always invalidated world price

New:

  • Two overloads:
    • One that removes by explicit id
    • One that removes by the derived specialsKey()
  • Both propagate the invalidateWorldPrice flag
  • Iterates through all owners, not just the direct owner
  • More robust cleanup — ensures that the special is removed everywhere it might exist

Other Part Changes

Added: extend public str annotationFlattenableKey() {}

With the addition of the new part attribute description/notes system, Parts now need to be differentiable/split by their attribute values.

The following helper function to generate the flattenable key for attributes has been made. It is appended to the flattenable key in flattenableKey():

/**
 * Flattened annotation note/descs key.
 * @return str of flattenable key of PartAnnotation(s)
 */
extend public str annotationFlattenableKey() {
	StrBuf buf();
	bool first = true;
	for (annotation in getAnnotations()) {
		if (first) first = false;
		else buf << ',';
		buf << annotation.key();
	}
	return buf.retireToS();
}
Changed: extend public str flattenableKey() {}

With the addition of the new part attribute description/notes system, Parts now need to be differentiable/split by their attribute values.

The following change has been made in flattenableKey to account for this:

/**
 * Flattenable key.
 */
extend public str flattenableKey() {
	StrBuf key;
	
	...
	
New:	key << annotationFlattenableKey();
	
	return key.any() ? key.retireToS() : articleCode();
}
Changed: extend public Object valueOf(PartColumn column) {}

With the addition of the new part attribute description and note columns in Calculations, the valueOf(..) function has been updated in Part to provide values for these columns.

This is mainly useful for the Excel order export and exporting a single, comma-delimited, str value for PartAttributeColumns.

/**
 * Normally returned from value method in 'column', this is a change to override it from part.
 */
extend public Object valueOf(PartColumn column) {
	if (column as PartAttributeColumn) {
		?str[] colVals = column.value(this, null);
		if (!colVals) return null;

		StrBuf valuesBuf();
		bool first = true;
		for (val in colVals) {
			if (first) first = false;
			else valuesBuf << ", ";
			valuesBuf << val;
		}

		return valuesBuf.retireToS();
	}
	return null;
}

Changed: extend public void updateItemTags() {}

With the addition of the new str articleCodeText field on ItemTagInfo, Part now sets this value during updateItemTags() if it is not already set. This ensures that the field has a value and that the new Control Panel setting for toggling article codes for Ind Tags is functional in most cases.

/**
 * Update the Item tags.
 */
extend public void updateItemTags() {
	...
	
	if (owner and acceptItemTags()) {
		if (ItemTags tags = owner.itemTags()) {
			if (ItemTag tag = tags.get(itemTagKey())) {
				...
	
New:			if (tag.info and !tag.info.articleCodeText) {
New:				tag.info.articleCodeText = articleCode();
New:				invalidate = true;
				}
				
				...
				return;
			}
		}
		...
	}
}

class FlattenedPartData

New Part-To-Owner Interface

A new interface, partToOwnerKeys, has been added to FlattenedPartData. These keys are str values that are unique for each Part within a single owner. Their purpose is to distinguish between multiple Parts on the same Snapper owner that may share the same flattenableKey but originate from different creators.

Example

Consider a table Snapper with four legs:

  • When processed, the table generates one Part for the tabletop and four Parts for the legs.
  • During part merging, if all four legs are identical, they may be flattened into a single leg Part.
  • The resulting FlattenedPartData contains an owners sequence pointing only to the table Snapper.
Previous Limitation

In this scenario, the flattened part had no way to reference the four individual leg parts that were merged together—it only knew about the shared owner.

New Behavior

The partToOwnerKeys interface resolves this gap by assigning unique keys for each contributing Part. This allows the flattened part to retain identifiers for the individual parts that generated it, ensuring traceability even after merging.

FlattenedPartData Modifications

To accomplish this, FlattenedPartData has a new field where the keys are stored (private str{} _partToOwnerKeys), a new accessor function (final public str{} partToOwnerKeys()), and a change in appendSimilar to build the keys. The appendSimilar function's purpose is to append a new Part to the flattened part info. It increases quantity, appends owners, and changes the level of the flattened part. It now also appends the passed in Part parts partToOwnerKey into the _partToOwnerKeys sequence.

In cm/core/part/flattenedPartData.cm 


New: private str{} _partToOwnerKeys;
New: final public str{} partToOwnerKeys() {}

Changed:
/**
 * Append a similar part.
 */
final public void appendSimilar(Part part, double multiplier) {
	appendOwnersFrom(part.data);

New:	if (!_partToOwnerKeys) init _partToOwnerKeys();
New:	_partToOwnerKeys << part.partToOwnerKey();

	_quantity += part.quantity()*multiplier;

	level = min(level, part.level());

	#if (!builtInReleaseMode) assert(_allowOtherParent == part.data.allowOtherParent);
}

class PartAnnotationHolder

See cm.core.part.attributes section in 16.5 New Features migration guide for new PartAnnotationHolder class documentation.

class PartGridBuilderEnv

Added: extend public Brush getCellBrush(Object data, int columnIdx) {}

  • Allows for customization of a row and columns cell background
  • Parameters:
    • Object data: Data for row to get cell brush for
    • int columnIdx: Column index to get cell brush for
Behavior
  • Returns whiteBrush by default

Added: extend public GridCell getDefaultCell(Object data, int columnIdx) {}

  • Gets default cell for row and column
  • Parameters:
    • Object data: Data for row to get default cell for (can be null)
    • int columnIdx: Column index to get default cell for
Behavior
  • Returns ColorNameGridCell("", bgColor=getCellBrush(..).color) by default

Added: extend public GridCell getPartRowCell(Part part, int columnIdx) {}

  • Gets part row cell for Part and column
  • Parameters:
    • Part part: Part for row to get cell for (can be null)
    • int columnIdx: Column index to get cell for
Behavior
  • If Part is null or column index is out of bounds, returns getDefaultCell(..)
  • Otherwise, returns a cell for the Part data associated with the column index
    • Assigns a background color to the cell by calling getCellBrush(..)

Changed: extend public GridCell[] getPartRowCells(Part part) {}

Old → New behavior

Old:

  • Directly returned a sequence of GridCells

New:

  • Loops through columns, calling getPartRowCell for each column and appending it to the returned GridCell sequence
  • Allows for more flexibility when building row cells

class PartAnnotation

See cm.core.part.attributes section in 16.5 New Features migration guide for new PartAnnotation class documentation.

cm/core/part/functions.cm Special functions

  • The parameter bool invalidateWorldPrice=true has been added to special functions
    • Gives the option to invalidate world price upon making changes to specials
    • Previously, world price was invalidated on every special change
Old: public void removeSpecialHolder(PropObj s) {}
New: public void removeSpecialHolder(PropObj s, bool invalidateWorldPrice=true) {}

Old: public void putSpecial(PropObj s, str key, PartSpecial special) {}
New: public void putSpecial(PropObj s, str key, PartSpecial special, bool invalidateWorldPrice=true) {}

Old: public void removeSpecial(PropObj s, str key) {}
New: public void removeSpecial(PropObj s, str key, bool invalidateWorldPrice=true) {}

Old: public void removeAllSpecials(PropObj s) {}
New: public void removeAllSpecials(PropObj s, bool invalidateWorldPrice=true) {}

cm.core.part.query

class PartMakeSpecialDialog

Changed: extend public void onOKButtonClick(Object sender, Object args) {}

The event callback for the OK button click has been modified to utilize the new generateSpecial method. It now calls generateSpecial rather than creating a special on the fly.

Old vs. New Behavior

Old:

  • Created a new PartSpecial within the event callback
  • Can easily lead to duplicated code if customization is needed for the generated PartSpecial
Old:
extend public void onOKButtonClick(Object sender, Object args) {
	PartSpecial newSpecial(partNumTF.text,
						   descrTF.text,
						   priceReplaceRB.currentState > 0,
						   amountDF.value);
	... 
}

New:

  • PartSpecial generation has been separated out into a designated function generateSpecial
    • PartSpecial can be customized here
  • The OK button click callback can now call this function along with performing its other behaviors
New:
extend public void onOKButtonClick(Object sender, Object args) {
	if (PartSpecial newSpecial = generateSpecial()) {
		...
	}
	...
}

Added: public void selectAll() {}

  • A new override of the selectAll function was added in QueryGridWindow
  • It was overridden to include the column header row on select all events
    • super() does not select this row in selectAll

Behavior

  • If grids selection mode is multi-select (isUsingMultiSelect == true):
    • Clears the seq of multiSelectedRows
    • Adds all rows from column headers (-1) to row count - 1 to multiSelectedRows
    • Invalidates and flushes grid

class QueryDialogBehavior

Changed: extend public void onSpecialChanged(Object sender, Object args) {}

Specials created or modified in the QueryDialog no longer replace the stored PartSpecial value on the PartSpecialHolder. Instead, their values are copied over to the existing PartSpecial instance.

Old vs. New Behavior

Old:

  • PartSpecials created or modified in the QueryDialog fully replaced existing PartSpecial instances
extend public void onSpecialChanged(Object sender, Object args) {
	if (sender as Window) {
		...		
		if (args as QuerySpecialChangedEventArgs) {
			dialog.putSpecial(dialog.selectedRowID(), args.newSpecial); // directly replaces existing PartSpecial
		}
	}
}

New:

  • PartSpecials created or modified in the QueryDialog copy their values over to the existing PartSpecial instance
extend public void onSpecialChanged(Object sender, Object args) {
	if (sender as Window) {
		...		
		if (args as QuerySpecialChangedEventArgs) {
			PartSpecial original = args.oldSpecial;
			original.copy(args.newSpecial); 							// copies new values to existing PartSpecial

			putSpecial(dialog, dialog.selectedRow(), original);
		}
	}
}

class EditGridCell

Added: public str clipboardValue() {}

  • An override of the GridCell function clipboardValue() has been added in EditGridCell. It returns the cells outS() value.

cm.core.toolbox

Core settings for toolboxCurrentTab changes

Following the changes to replace the lastSelectedTab field with lastSelectedTabKey in tbInfo.cm, the last selected tab is now stored as a str instead of an int in core settings. Although the key remains unchanged as toolboxCurrentTab_<toolboxCardKey>, developers may need to modify the casting type when retrieving the key from an int to a str to accommodate for this change.

cm.core.user

class CoreDistanceField

The mouse over tooltip now always display the distance with the same precision as the field value itself. Previously, the tooltip would be shown with the precision of the currently selected "Dimensions" style from the Tools toolbox.

It is now also possible to specify the precision of CoreDistanceFields that are created from props, by setting the unitPrecision argument in the PropInputSettings. For example, to set the precision to be the same as the currently selected "Dimensions" style, use unitPrecision=defaultUserDimensionStylePrecision().

public class MyAnimation extends Animation {
    public props {
	    "length" : setting=PropInputSetting(unitPrecision=defaultUserDimensionStylePrecision());
    }
}

cm.import.sqlite

SQliteDB

SQLiteDb's abort() function is now rectified to execute ROLLBACK instead of COMMIT, which will erroneously commit unwanted changes to the DB.

cm.runtime

The reflection class Field has a method named copyShallow() that is intended to indicate whether or not that field is marked as copy=shallow. However, it was actually returning a value that correlated to the field being copy=null. As of 16.5, this has been corrected to return a value that matches the intented behavior.

cm.win

IconFinder

For icons resisiding in base/res/images/, CET will now return a DibImage instead of MemoryImage. This is to reduce reliance on GDI bitmap objects to display the CET UI. This only affects calls to icon that have their key "#default" or by calling dibIcon, such as:

icon("partTag")
icon("partTag", key=#default)

dibIcon("panel_frame.png", key=#fikaOffice);

For existing code that performed a cast check to MemoryImage, you have to migrate the code to also handle DibImage. Common issues are:

  • Images not loading
  • Disabled images are not grayed out (blend is not applied)

One such example is listed below:

// Previous logic only handles MemoryImage
byte beforeBlend = 255;
if (image as MemoryImage) {
    beforeBlend = image.blend;
    image.blend = 100;
}
image.transparentDraw(c.hdc, imgPos);
if (image as MemoryImage) image.blend = beforeBlend;

// New logic now handles MemoryImage, DibImage and SvgImage
byte beforeBlend = image.blend;
image.blend = 100;
image.transparentDraw(c.hdc, imgPos);
image.blend = beforeBlend;

Improved lifecyle of Images

In previous versions of CET, IconFinder would pass use=true when constructing an image. This would cause the Image to always be loaded as the image will never be destroyed (refCount never goes down to 0).

This has now been updated to not pass use=true, instead your dialog / control should be handling the use and release of the image. This is not required for ImagePainter as they already handle the use and release for you.

You may retrieve a terminated (blank) icon in some scenarios:

  • Retrieving an icon and directly drawing in your draw / repaint method.
  • Assigning an icon to a field and using it later.

A common pattern to fix this is to assign and use the icon on construction. Followed by releasing it on destruction (beforeRemove / removeWindow). This is used by BrushHoverDropDownMenuButton.

    /**
     * Second image.
     */
    private Image secondImage : package readable;


    /**
     * Constructor.
     */
    public constructor(Window parent, ...
                       Image secondImage=null, ...) {
        ...
        setSecondImage(secondImage, refresh=false);
        ...
    }


    /**
     * Set second image.
     */
    final public void setSecondImage(Image image, bool refresh=true) {
        if (this.secondImage) this.secondImage.release();
        this.secondImage = image;
        if (this.secondImage) this.secondImage.use();
        if (refresh) refresh();
    }


    /**
     * Before remove event, sent to all children (leaf first) before remove.
     */
    public void beforeRemove() {
        if (secondImage) secondImage.release();
        secondImage = null;
        super();
    }

Another example where we are not using a Window, but relying on finalizer for CustomTitleBar.

    /**
     * Right side icons.
     */
    private Image minimizeIcon;


    /**
     * Build a custom title bar using the config.
     */
    public constructor(FrameWindow parent, TitleBarConfig config) {
        ...
        minimizeIcon = dark ? icon("win/minimizeLight") : icon("win/minimizeDark");
        if (windowIcon) windowIcon.use();
        ...
    }


    /**
     * Retire if GCed.
     */
    private finalizer() {
        if (captionBrush) retire();
    }


    /**
     * Retire.
     */
    final public void retire() {
	    if (windowIcon) windowIcon.release();
	    windowIcon = null;
        ...
    }

Auto remember position and size

AppWindow and DialogWindow have the following overrides, subclasses now will automatically remember their last dialog position and size. If this causes issues with your dialog, you can override the methods in your own dialog to return false.

Old: public bool autoSavePos() { return false; }
New: public bool autoSavePos() { return true; }

Old: public bool autoSaveSize() { return false; }
New: public bool autoSaveSize() { return true; }

ComboTextPainter

setBound(rectI r) now attempts to reset its contained TextPainter width before autoSizing to make consistent initial width calculation when painting text. This potentially affects how text can be painted and truncated automatically.

class TextInputGridCell

Added: public bool keyTab() {}

Advances input focus from a TextInputGridCell to the next cell in the parent GridWindow on user tab-click.

/**
 * Key tab.
 */
public bool keyTab() {
	GridWindow gw = gw();
	if (gw) {
		gw.setFocus();
		gw.keyTab();
	}
	return true;
}

class GridWindow

Changed: extend public str clipboardValueIfAny(int x, int y) {}

  • The clipboardValueIfAny method in the grid was updated to handle MoneySumGridCell objects.

Changed: extend public int appendRow(str label=null, bool update=true) {}

appendRow(..) has been updated to call updateScrollBars() when the update parameter is true.

/**
* Append a new row and return the new row index.
*/
extend public int appendRow(str label=null, bool update=true) {
	...
	
	if (update) {
		updateRowSize(index);
		updateColumnSize(-1, updateRows=false);
New:	updateScrollBars();
		refreshG2();
	}

	...

	return index;
}