-
FlexPro
- At a Glance
- Features & Options
- Applications
- All Advantages
- What’s New in FlexPro 2021
- Try FlexPro For Free
- FlexPro View OEM Freeware
- Buying Guide
- Login
- Language
- +49 6894 929600
- infoweisang.com
- Google Maps
- Products
- News
- Support
- Company
- Contact
- 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
- This topic has 2 replies, 2 voices, and was last updated 21 years, 2 months ago by Krista Tweed.
-
AuthorPosts
-
September 10, 2003 at 5:29 am #12446Krista TweedMember
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 at 11:57 pm #8741Bernhard KantzParticipantTo 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 at 11:57 pm #8127Krista TweedMemberI 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 ?
-
AuthorPosts
- You must be logged in to reply to this topic.