[fixed] leader line disappears when reopening document

Discussions about the development of the TechDraw workbench
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: leader line disappears when reopening document

Post by uwestoehr »

wandererfan wrote: Sun Jan 12, 2020 11:44 pm Thanks to @wmayer's hints, this should be fixed by git commit 00c69a9c64.
Many thanks!
It is not completely fixed, because the line is now shown, but without its color. It has a red color and when reopening the document the line is shown in black.
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: leader line disappears when reopening document

Post by uwestoehr »

wandererfan wrote: Thu Jan 09, 2020 12:48 am All those "Draw" prefixes are a legacy of when TechDraw was Drawing v2.0.
I wanted to make a PR but cannot find where in the code the name is defined. Do you have a pointer for me?
User avatar
wandererfan
Veteran
Posts: 6309
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: leader line disappears when reopening document

Post by wandererfan »

uwestoehr wrote: Mon Jan 13, 2020 12:08 am I wanted to make a PR but cannot find where in the code the name is defined. Do you have a pointer for me?
This one is in TaskLeaderLine.cpp. For others, look for "getUniqueObjectName("Draw*"

Code: Select all

void TaskLeaderLine::createLeaderFeature(std::vector<Base::Vector3d> converted)
{
//    Base::Console().Message("TTL::createLeaderFeature()\n");
    m_leaderName = m_basePage->getDocument()->getUniqueObjectName("DrawLeaderLine");
    m_leaderType = "TechDraw::DrawLeaderLine";

    std::string PageName = m_basePage->getNameInDocument();

    Gui::Command::openCommand("Create Leader");
    Command::doCommand(Command::Doc,"App.activeDocument().addObject('%s','%s')",
                       m_leaderType.c_str(),m_leaderName.c_str());
User avatar
wandererfan
Veteran
Posts: 6309
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: leader line disappears when reopening document

Post by wandererfan »

uwestoehr wrote: Mon Jan 13, 2020 12:05 am It is not completely fixed, because the line is now shown, but without its color. It has a red color and when reopening the document the line is shown in black.
Ok, I'll look at it tomorrow.
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: leader line disappears when reopening document

Post by uwestoehr »

wandererfan wrote: Mon Jan 13, 2020 1:46 am For others, look for "getUniqueObjectName("Draw*"
Many thanks. In fact it was really that easy: https://github.com/FreeCAD/FreeCAD/pull/2894

I tested it after the renaming and don't see any drawbacks so far.
User avatar
wandererfan
Veteran
Posts: 6309
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: leader line disappears when reopening document

Post by wandererfan »

uwestoehr wrote: Mon Jan 13, 2020 12:05 am It is not completely fixed, because the line is now shown, but without its color. It has a red color and when reopening the document the line is shown in black.
Colors & styles should be fixed by git commit d64d6a7c65
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: leader line disappears when reopening document

Post by uwestoehr »

wandererfan wrote: Tue Jan 14, 2020 12:32 pm Colors & styles should be fixed by git commit d64d6a7c65
many thanks! Confirmed that this is now fixed.
Post Reply