How can i save a personal topic and its subtopics as a map part programmatically?

luisfernandomerlano shared this question 3 months ago
Discussion Open

My interest is using many times a topic and its subtopics, and therefore is very important to save it as a map part; but i want to do this programmatically.

Could some expert kindly help me?


thanks in advance

Replies (2)

photo
1

Hello Luis

This can be done but is not very robust. I have been able to make this work but the map parts generated are not editable in some versions of MindManager, so it contains flaws. A map part is a special case of a MindManager map, where the text in the central topic is the map part name, there is only one Main Topic (which is the root topic of the Map Part), and there is no theme or style information. You can see this if you open a map part for editing. However, Floating Topic collections can now be saved as Map Parts, but I don't know how this is encoded in a map part file.

To save a map part programmatically I did the following:

  • Create an empty map, set to invisible
  • Set the central topic text to the name of the map part
  • Add one Main Topic
  • Set the main topic XML to the XML of the source tree (the tree you want to save as a map part)
  • Save the document as a .mmmp file (using the same name as the central topic text) and close it.

This produces files that can be inserted as map parts but as mentioned I have had difficulty editing them in some versions of MindManager, so there is something not quite right. There may be other things that I have not included such as correctly setting up the map marker collections. I would welcome any other insights or improvements.

photo
1

Hi Nick


Thanks a lot for your quickly response, could you kindly show me a little part of an example code, i know the instructions to follow the steps 2 ,3 and 5; but not the 1 and 4. again1 thank you for your support and help


Luis

photo
1

Hello Luis

To create a hidden document, you can use

Set doc = Documents.Add(False)

Until everything is working, it would be better not to hide this document, so just use Set doc = Documents.Add()

To set the XML, where m_Source is the source topic and m_Dest is the destination:

m_Dest.xml = m_Source.xml

Best regards

Nick

photo
1

Hello Nick

Thank you so much for your support, always so kind.

With success i was able to build my code and it works fine. However there appears a warning at the moment of save the new mappart that i would want to omit, in order that my code doesn´t have interruptions.

once again i ask for your advice.


please see the attachment which contains the warning.


thanks un advance

photo
1

Hello Luis

I think this message is coming from the WordX Add-In from Olympic. I will ask Nigel Goult to comment on how this can be avoided.

photo
1

Hello Luis,

The WordX error message you are getting is caused by the map having had a WordX template applied which has either been deleted, removed or is otherwise not accessible to the add-in.

Re-applying a new template to the map or ensuring the applied template is available in the original location from when it was applied should resolve this.

If you have any further issues or questions please contact me through our support page on our website here:

https://www.olympic-limited.co.uk/support/

and I can then deal with any further problems within our normal support framework.

photo
Leave a Comment
 
Attach a file