[ccmasterkernel] How to set only one positioning method for adjustment constraints for AT settings using the SDK?

I'm having difficulty modifying settings for the AT in the python SDK, more precisely on how to only set positioning with control points to the adjustment constraints. Do you have an example for that?

I'm always getting 2 methods instead of only having the control points one.

Thank you

  • I'm not able to reproduce this issue, can you share you script? I have good results using the following functions:

    blockAT=ccmasterkernel.Block(project)
    project.addBlock(blockAT)
    blockAT.setBlockTemplate(ccmasterkernel.BlockTemplate.Template_adjusted, block)
    settings=blockAT.getAT().getSettings()
    settings.adjustmentConstraints=ccmasterkernel.AdjustmentAndPositioning.Positioning_ControlPoints
    print(settings.adjustmentConstraints)
    blockAT.getAT().setSettings(settings)
    blockAT.getAT().submitProcessing()

    Thanks

  • try:
        import ccmasterkernel
    except Exception as e:
        print(e)
    project = ccmasterkernel.Project()
    err = project.readFromFile(pathtToProject)
    if not err.isNone():
        print("Failed to load project. " + err.message)
    block = project.getBlock(0)
    blockAT = ccmasterkernel.Block(project)
    project.addBlock(blockAT)
    blockAT.setBlockTemplate(ccmasterkernel.BlockTemplate.Template_adjusted, block)
    blockAT = project.getBlock(project.getNumBlocks() - 1)
    atSettings = blockAT.getAT().getSettings()
    atSettings.adjustementConstraints = ccmasterkernel.bindings.AdjustmentAndPositioning.Positioning_ControlPoints
    atSettings.rigidRegistration = ccmasterkernel.bindings.AdjustmentAndPositioning.Positioning_None
    atSettings.loadPreset(pathToPreset)
    print(atSettings.adjustementConstraints)
    blockAT.getAT().setSettings(atSettings)
    atSubmitError = blockAT.getAT().submitProcessing()
    if not atSubmitError.isNone():
        print("Error: Failed to submit aerotriangulation." + atSubmitError.message)

    blockAT.setChanged()
    project.writeToFile()
    It prints: Positioning_ControlPoints but when i open the project in ccmaster it still has the two options selected.

  • It works fine on my side when I check the project settings in ccmaster...

    Could you try to skip the "loadPreset" line and see if it fixes the issue?
    If yes, could you share the preset file you load?

    Thanks

  • Yes it works... But shouldn't only affect the second part of the settings?

    ATSettings.cfg

  • Adjustment constraints and rigid registration options are also defined in the AT settings file so loading it before updating some options should solve your problem.

    The python script should not print "Positioning_ControlPoints" only... I'll check this on my side.

    Thanks