-
FlexPro
- Auf einen Blick
- Features & Optionen
- Einsatzgebiete
- Alle Vorteile
- Neu in FlexPro 2021
- FlexPro gratis testen
- FlexPro View OEM Freeware
- Kaufberatung
- Login
- Language
- +49 6894 929600
- infoweisang.com
- Google Maps
- Produkte
- News
- Support
- Unternehmen
- Jobs
- Kontakt
- Login
- Language
- +49 6894 929600
- infoweisang.com
- Google Maps
Copying markers from a diagram to a document
Home > Community > Automation and VBA > Copying markers from a diagram to a document
- Dieses Thema hat 2 Antworten sowie 2 Teilnehmer und wurde zuletzt vor vor 21 Jahren, 2 Monaten von Krista Tweed aktualisiert.
-
AutorBeiträge
-
September 10, 2003 um 5:29 am Uhr #12446Krista TweedMitglied
I am writting a VBA application that needs to copy the Markers text from a 2D-Diagram to the 2D-Diagram included in a Document.
I have a 2D-Diagram with two curves and a Document which contains a copy of the 2D-Diagram. I set several markers in the 2D-Diagram and then I run my macro to copy only some of the markers into the document.
The macro is able to copy the markers with X and Y coordinates but is unable to change the text of the marker.
Here is a part of the macro :
——————————————
Dim Diagramme As Diagram2D
Dim Doc As Document
Dim NbMarkers As Integer‘Activate 2D-Diagram object
ActiveDatabase.RootFolder.Object (“2D-Diagram.2D”)
Set Diagramme = ActiveDatabase.ActiveObject‘get NbMarkers in the 2D-Diagram object
NbMarkers = ActiveDatabase.ActiveObject.Markers.Count‘Activate the Document Object
Windows(“CalculsDocument (Document)”).Activate‘Activate the 2D-Diagram object in the document
ActiveDatabase.ActiveObject.Pages(1).Item(1).SelectSet Doc = ActiveDatabase.ActiveObject
‘Active cursors
Doc.CursorActive = True‘Autocenter Off
Doc.ActiveCursor.Bounded = False‘Place cursorX and cursorY in the document
Doc.ActiveCursor.PositionX = TabMarker(i, 0)
Doc.ActiveCursor.PositionY = TabMarker(i, 1)‘Place marker in the document
Doc.ActiveCursor.PlaceMarker‘Change the marker text
ActiveDatabase.ActiveObject.Markers.Item(1).Text=”O1″—————————————————————————-
The last line ActiveDatabase.ActiveObject.Markers.Item(1).Text=”O1″ changes the marker text in the “2D-Diagram” but not in the document .
Is it possible to change the text of the markers only in the document and not in the original 2D-Diagram ?
September 29, 2003 um 11:57 pm Uhr #8741Bernhard KantzTeilnehmerTo understand this problem, you need to know that, when a diagram is linked to different locations (document and/or worksheets), the markers are stored individually for each location.
If you link a diagram to a document, then the document is storing the markers for the linked diagram along with other attributes like the individual horizontal and vertical dimensions of the linked diagram for example.As far as we investigated the problem, there seems to be no solution for it currently. The reason for that is that the marker text in a linked diagram in a document is addressable only while the diagram is inplace active, which means it is displayed with a dashed border inside the document. Unfortunately, the Automation Object Model for FlexPro is missing a method to inplace-activate an object.
An alternative solution would be to address the markers through the CursorObject interface. When you change the marker text, then the marker closest to the active cursor in the active item (linked diagram) of the active CursorObject (Document) is changed. But the Object Model is also missing a method to address the active item in a CursorObject.
We will further investigate on this problem and extend the object model so that it will be possible to perforem the requested operation.
September 29, 2003 um 11:57 pm Uhr #8127Krista TweedMitgliedI am writting a VBA application that needs to copy the Markers text from a 2D-Diagram to the 2D-Diagram included in a Document.
I have a 2D-Diagram with two curves and a Document which contains a copy of the 2D-Diagram. I set several markers in the 2D-Diagram and then I run my macro to copy only some of the markers into the document.
The macro is able to copy the markers with X and Y coordinates but is unable to change the text of the marker.
Here is a part of the macro :
——————————————
Dim Diagramme As Diagram2D
Dim Doc As Document
Dim NbMarkers As Integer‘Activate 2D-Diagram object
ActiveDatabase.RootFolder.Object (“2D-Diagram.2D”)
Set Diagramme = ActiveDatabase.ActiveObject‘get NbMarkers in the 2D-Diagram object
NbMarkers = ActiveDatabase.ActiveObject.Markers.Count‘Activate the Document Object
Windows(“CalculsDocument (Document)”).Activate‘Activate the 2D-Diagram object in the document
ActiveDatabase.ActiveObject.Pages(1).Item(1).SelectSet Doc = ActiveDatabase.ActiveObject
‘Active cursors
Doc.CursorActive = True‘Autocenter Off
Doc.ActiveCursor.Bounded = False‘Place cursorX and cursorY in the document
Doc.ActiveCursor.PositionX = TabMarker(i, 0)
Doc.ActiveCursor.PositionY = TabMarker(i, 1)‘Place marker in the document
Doc.ActiveCursor.PlaceMarker‘Change the marker text
ActiveDatabase.ActiveObject.Markers.Item(1).Text=”O1″—————————————————————————-
The last line ActiveDatabase.ActiveObject.Markers.Item(1).Text=”O1″ changes the marker text in the “2D-Diagram” but not in the document .
Is it possible to change the text of the markers only in the document and not in the original 2D-Diagram ?
-
AutorBeiträge
- Du musst angemeldet sein, um auf dieses Thema antworten zu können.