Spire.Presentation is a professional PowerPoint® compatible library that enables developers to create, read, write, modify, convert and Print PowerPoint documents. Get free and professional technical support for Spire.Presentation for .NET, Java, Android, C++, Python.

Fri Sep 04, 2020 7:36 am

Hi Rachel,

Thanks for providing code similar to hiding a node.

I tried your code and found that it is doing similar to hiding border line of node but it wont do the same for link line/connectors. Please see details below:

First, I have added a parent node(node_parent) into a SmartArt and then added 3 child nodes to it.i applied your code to hide parent node and for it's link line/connectors , it seems that parents node is hided but the link line/connector of it which connected to it's child's not hided. so that is the issue. it should hide the parent node and link line/connector of it which connected to it's child's node. I have attached Output file(result new) from my code and a screenshot file (Screenshot with highlighted connector line in yellow) which showing highlighted link line/connector in yellow which having issue for your reference.
Also please see the code which i have used:

Dim ppt As Presentation = New Presentation()
Dim smartArt As ISmartArt
Dim node_parent As ISmartArtNode
Dim midNode As ISmartArtNode
Dim gcNode As ISmartArtNode
ppt.LoadFromFile("C:\Users\A0741818\Documents\Visual Studio 2015\WebSites\Hyperlink Error on node in SmartArt in PPT\Presentation_node and connecter formatting.pptx")
smartArt = ppt.Slides(0).Shapes.AppendSmartArt(50, 50, 500, 500, SmartArtLayoutType.OrganizationChart)
smartArt.Style = SmartArtStyleType.SimpleFill
smartArt.ColorStyle = SmartArtColorType.ColoredOutlineAccent3
For Each node As ISmartArtNode In smartArt.Nodes
smartArt.Nodes.RemoveNode(node)
Next
node_parent = smartArt.Nodes.AddNode()
'format border line of a node
node_parent.Line.FillType = Drawing.FillFormatType.None
'format connector line
node_parent.LinkLine.FillType = Drawing.FillFormatType.None

Dim node_Mapped_Manager As ISmartArtNode = node_parent.ChildNodes.AddNode()
' node_Mapped_Manager.LinkLine.FillType = Drawing.FillFormatType.None

Dim node_Dotteled_Line_Manager1 As ISmartArtNode = node_parent.ChildNodes.AddNode()
node_Dotteled_Line_Manager1.Line.FillType = Drawing.FillFormatType.Solid
node_Dotteled_Line_Manager1.Line.SolidFillColor.Color = System.Drawing.Color.LightGray
node_Dotteled_Line_Manager1.Line.Width = 1
node_Dotteled_Line_Manager1.Line.CapStyle = LineCapStyle.Round
node_Dotteled_Line_Manager1.Line.DashStyle = LineDashStyleType.SystemDot

Dim node_Dotteled_Line_Manager2 As ISmartArtNode = node_parent.ChildNodes.AddNode()
node_Dotteled_Line_Manager2.Line.FillType = Drawing.FillFormatType.Solid
node_Dotteled_Line_Manager2.Line.SolidFillColor.Color = System.Drawing.Color.LightGray
node_Dotteled_Line_Manager2.Line.Width = 1
node_Dotteled_Line_Manager1.Line.CapStyle = LineCapStyle.Round
node_Dotteled_Line_Manager2.Line.DashStyle = LineDashStyleType.SystemDot

ppt.SaveToFile("C:\Users\A0741818\Documents\Visual Studio 2015\WebSites\Hyperlink Error on node in SmartArt in PPT\result new.pptx", FileFormat.Pptx2013)

Note:- the first node is not visible in output file due to code applied to hide it. Please see this node in row one to select this in output file .

Moreover, there is one more on going issue that both border line of node and link line/connector of node not allowing to set RGB color of them. it's providing only default colors name feasibility. we need to add RGB color for them..

Thanks in advance. Looking for a positive response.


Thanks & Regards,
Anil Kumar

anilbits001
 
Posts: 41
Joined: Thu Sep 05, 2019 12:50 pm

Fri Sep 04, 2020 9:26 am

Hi Anil,

Thanks for your feedback.
In fact, the highlighted connector line in your screenshot is not of the parent node, it is part of the child node connector line. You should set the line style for the child node connector, as shown below, and see the attached screenshot for the final result.
Code: Select all
        node_parent = smartArt.Nodes.AddNode()
        node_parent.Line.FillType = Drawing.FillFormatType.None
        'node_parent.LinkLine.FillType = Drawing.FillFormatType.None

        Dim node_Mapped_Manager As ISmartArtNode = node_parent.ChildNodes.AddNode()
        node_Mapped_Manager.LinkLine.FillType = Drawing.FillFormatType.None
        '...

        Dim node_Dotteled_Line_Manager1 As ISmartArtNode = node_parent.ChildNodes.AddNode()
        node_Dotteled_Line_Manager1.LinkLine.FillType = Drawing.FillFormatType.None
        '...

        Dim node_Dotteled_Line_Manager2 As ISmartArtNode = node_parent.ChildNodes.AddNode()
        node_Dotteled_Line_Manager2.LinkLine.FillType = Drawing.FillFormatType.None
        '...


As for setting RGB color, below is the code for your reference.
Code: Select all
        note.Line.SolidFillColor.Color = System.Drawing.Color.FromArgb(255, 0, 0)
       '...
        note.LinkLine.SolidFillColor.Color = System.Drawing.Color.FromArgb(0, 255, 0)
       '...



Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Fri Sep 04, 2020 11:23 am

Hi Rachel,

Thanks for quick response.

Now,the setting RGB color is working for line and link line of node.

However Regarding setting line style of it's child's node connector it hide the entire connector line from parent node to all it's child's. So, After setting fill type to none for the three child nodes it's hiding the entire connector line from parent node to child node but we required the only horizontal connector line should be there and vertical line should be hided.

We have a requirement that need to show child's node of a parent node should be right side of parent node and connectors of child's node below them like in attachment(Hiligthed connector lines.png) .Please see .PNG file name as Hiligthed connector lines.png in attachment. but it seems that Smartart do not have like this feasibility to add child node like this and their connector also.
So we thought a different approach here that we have added a new root node above the parent node and then added three child nodes(parent node,child node 1 and child node 2) to root node. after that thought if we can hide the root node and the vertical connector of it then our requirement will done. But, from this approach it don't hiding the vertical connector line from root node to it's child nodes.

I have also attached three files from your reference.
1. Hiligthed connector lines.png - Our requirement if we can do like this then it's really really great.
2. Current output from code.pptx- see vertical line comingit should be not there.
3. Desired output -after removing higlighted yello vertcal line.png - option second after removing highlighted yellow part if we can achieve like then then it will also fine.

So please provide the feasibility any of out of above so we can do our development .

Thanks in advance. Looking for a positive response.

Thanks & Regards,
Anil Kumar

anilbits001
 
Posts: 41
Joined: Thu Sep 05, 2019 12:50 pm

Mon Sep 07, 2020 6:04 am

Hi Anil,

Thanks for your response.
Regarding hiding the vertical line you said, as I mentioned in the above screenshot, setting the outline style for a part of the connector line is not supported. But I found that in Microsoft PowerPoint, you can adjust the position of the nodes to adjust the position of the connecting lines, as shown below.
Operations in Microsoft PowerPoint.png

But unfortunately, setting/getting the position of the node is not supported by our product at present. We have added it as a new feature to our upgrade list with the ticket SPIREPPT-1300. If it is implemented, we will let you know.

As for the effect in the picture "Hiligthed connector lines.png" you provided, as you know, SmartArt does not support adding nodes like that.

Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Fri Sep 11, 2020 11:04 am

Hi Rachel,

Thanks for the confirmation,

Please let us know once the 'setting/getting the position of the node' functionality implemented in spire.presentation.


Thanks in advance. Looking for a positive response.


Thanks & Regards,
Anil Kumar

anilbits001
 
Posts: 41
Joined: Thu Sep 05, 2019 12:50 pm

Mon Sep 14, 2020 1:18 am

Hi Anil,

Thanks for your response.
I just checked the status of the new feature and found that is has been completed. Our Test team is now testing it, and after it passes the test, we will prepare a new version for you ASAP.

Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Return to Spire.Presentation