Broadcastic Posted March 8, 2015 Share Posted March 8, 2015 Need some help with Office API Shapes.Nodes.Points Should get an array instead I get a string line 78 expandcollapse popup#include "PowerPoint.au3"; ;#include <excel.au3> ;include <misc.au3> Global $OldShape; $oMyError = ObjEvent("AutoIt.Error","MyErrFunc") $shapeTextBox=1; $shapeRegPentagon=12; $shapeFlowChart=73; ;~ Global $oExcel = _Excel_Open(); ;~ $WorkBook=_Excel_BookOpen($oExcel,@ScriptDir&"\Answers.csv") ;~ $oSheet = $oExcel.Worksheets.Item(1); ;~ $ReportMaxRows = $oSheet.UsedRange.Rows.Count; ;~ ;$oExcel.ActiveSheet.Range("A2:G:G").Columns.AutoFit $objPPT = _PPT_PowerPointApp() If @error Then MsgBox(0,"","No PowerPoint available") Exit EndIf $MyPres=_PPT_PresentationOpen($objPPT,@ScriptDir&"\OctaElements2.pptx"); $MySlide=$MyPres.Slides.Item(1); for $index=1 to $MySlide.Shapes.Range.Count ;$Text=_PPT_SlideTextFrameGetText($MyPres,1,$index); $MyShape=$MySlide.Shapes.Range($index); $ObjName=$MyShape.Name; $ObjTop=$MyShape.Top; $ObjLeft=$MyShape.Left; $ObjType=$MyShape.Type; $group=$MyShape.GroupItems; if $ObjType =6 Then $groupCount=$group.Count; Else $groupCount=0; EndIf ;ConsoleWrite(@CRLF&"Obj"&$index&"="&$ObjName&" has "&" items"&@CRLF&" top:"&$ObjTop&" left:"&$ObjTop&" type:"&$ObjType&@CRLF); ConsoleWrite(@CRLF&"Obj"&$index&"="&$ObjName&" has "&$groupCount&" items"&@CRLF&" top:"&$ObjTop&@CR&" left:"&$ObjTop&@CRLF); if $ObjType =6 Then for $indx2=1 to $group.Count; $gr=$group.Item($indx2); if IsObj($gr) Then $ObjName=$gr.Name; $ObjTop=$gr.Top; $ObjLeft=$gr.Left; $ObjType=$gr.AutoShapeType; if $ObjType = $shapeFlowChart Then $gr.left=$gr.left+10; $gr.top=$gr.top-10; EndIf ConsoleWrite(@CRLF&"Inside Obj"&@CRLF&$ObjName&@CRLF&" top:"&$ObjTop&@CR&" left:"&$ObjTop&@CR&" type:"&$ObjType&@CRLF); if IsObj($gr.Nodes) then ConsoleWrite(@CRLF&"Nodes "&$gr.Nodes.Count); EndIf Dim $arrPoints; for $node in $gr.Nodes $arrPoints=$node.Points; ConsoleWrite(@CRLF&"Points"&@CRLF&VarGetType($arrPoints)&@CRLF); ; ConsoleWrite(@CRLF&"Points"&@CRLF&$arrPoints[0][0]&@CRLF); Next EndIf Next EndIf next; ;_PPT_PresentationClose($MyPres); ;_PPT_PowerPointQuit($objPPT); Link to comment Share on other sites More sharing options...
Broadcastic Posted March 8, 2015 Author Share Posted March 8, 2015 I have a group of basic shapes on a slide. Need to get some Node Points coordinates Node object seems to be accessible with Count and other properties Obj1=Group 83 has 5 items top:37.0654335021973 left:37.0654335021973 Inside Obj Regular Pentagon 86 top:54.1135444641113 left:54.1135444641113 type:12 Nodes 6 Points String Points String Points String Points String Points String Points String Inside Obj TextBox 87 top:126.09464263916 left:126.09464263916 type:1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now