[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

Parents
  • 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.

Reply
  • 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.

Children