FlexPro
HistoryBase
Ingénierie
Formation
Téléchargements
Assistance FlexPro
Connaissance
Communauté
À propos de nous
Références
Emplois
Contact général
Liste des revendeurs
Assistance FlexPro
FR
DE
EN
Porte-plaquette
Produits et solutions
Support et téléchargements
Entreprise
Magazine
Contact
Langue
MyWeisang

Paramètres du compte.

Topic

"Active" diagram when worksheet not open

Page d'accueil ' Communauté ' FPScript ' "Active" diagram when worksheet not open

Voir les messages de 4 - 1 à 4 (sur un total de 4)
  • Auteur
    Messages
  • #33424

    I have written the following code in FPScript to integrate a flow signal to allow volume calibration. The first two marks indicate a segment of the file with no flow, in order to remove any offset in the signal, and then three “pumps” with a calibrated syringe are integrated, and the results returned. The problem I have is that if the WorkSheet is not open, there is no “Active” diagram, so “Marks=WorkSheet.WKS.MarksIndexX(0)” returns an empty set. This occurs even if the proper folder is active.

    Any suggestions?

    Thanks,

    Paul Warshawsky

    Dim Marks,Offset,V1,V2,V3,V4,V5,V6
    Marks=WorkSheet.WKS.MarksIndexX(0)
    Marks=Sort(Marks,SORT_X)
    Offset=Average(c04[Marks[0],Marks[1]])
    V1=(Integral(c04[Marks[1],Marks[2]]-Offset))[Marks[2]-Marks[1]]
    V2=(Integral(c04[Marks[2],Marks[3]]-Offset))[Marks[3]-Marks[2]]
    V3=(Integral(c04[Marks[3],Marks[4]]-Offset))[Marks[4]-Marks[3]]
    V4=(Integral(c04[Marks[4],Marks[5]]-Offset))[Marks[5]-Marks[4]]

    V5=(Integral(c04[Marks[5],Marks[6]]-Offset))[Marks[6]-Marks[5]]

    V6=(Integral(c04[Marks[6],Marks[7]]-Offset))[Marks[7]-Marks[6]]
    Return({3/((V1+V3+V5-V2-V4-V6)/6), V1, V3, V5, V2, V4, V6})

    #33421

    I have written the following code in FPScript to integrate a flow signal to allow volume calibration. The first two marks indicate a segment of the file with no flow, in order to remove any offset in the signal, and then three “pumps” with a calibrated syringe are integrated, and the results returned. The problem I have is that if the WorkSheet is not open, there is no “Active” diagram, so “Marks=WorkSheet.WKS.MarksIndexX(0)” returns an empty set. This occurs even if the proper folder is active.

    Any suggestions?

    Thanks,

    Paul Warshawsky

    Dim Marks,Offset,V1,V2,V3,V4,V5,V6
    Marks=WorkSheet.WKS.MarksIndexX(0)
    Marks=Sort(Marks,SORT_X)
    Offset=Average(c04[Marks[0],Marks[1]])
    V1=(Integral(c04[Marks[1],Marks[2]]-Offset))[Marks[2]-Marks[1]]
    V2=(Integral(c04[Marks[2],Marks[3]]-Offset))[Marks[3]-Marks[2]]
    V3=(Integral(c04[Marks[3],Marks[4]]-Offset))[Marks[4]-Marks[3]]
    V4=(Integral(c04[Marks[4],Marks[5]]-Offset))[Marks[5]-Marks[4]]

    V5=(Integral(c04[Marks[5],Marks[6]]-Offset))[Marks[6]-Marks[5]]

    V6=(Integral(c04[Marks[6],Marks[7]]-Offset))[Marks[7]-Marks[6]]
    Return({3/((V1+V3+V5-V2-V4-V6)/6), V1, V3, V5, V2, V4, V6})

    #33422
    Bernhard Kantz
    Participant

    Accessing the marks or cursors of a diagram in a worksheet or document is currently only possible if the worksheet or document is opened. In case of a document, the cursors have to be enabled too.

    When accessing the marks, this restriction seems to be not necessary and we will try to find a way to remove it.

    Until we change that behaviour, you need to open the worksheet for your formula to work properly. Maybe you can write a VBA event handler to automatically open the worksheet(s) when you open your database.

    support@weisang.com

    #33423
    Bernhard Kantz
    Participant

    This problem has been solved in FlexPro 7. You can now access the cursors in a closed worksheet.

Voir les messages de 4 - 1 à 4 (sur un total de 4)
  • Vous devez être connecté pour répondre à ce sujet.