public void SendtoWord(PlanSwift.Item AItem) { object IType, ItemProp, ITab; String IQty, IName, IPriceEach, IPriceTotal, INumber; IType = AItem.ItemType; ItemProp = AItem.Properties; ITab = TGlobal.pc.Tabs.SelectedTab().Name; IName = AItem.Name; if (AItem.ItemType != PlanSwift.ItemType.itFolder) { if (ItemNumber >= 20) { object beforeRow = oWord.ActiveDocument.Tables[2].Rows[ItemNumber]; oDocument.Tables[2].Rows.Add(ref beforeRow); } INumber = AItem.Properties.ByName("Item #").Value(); IQty = AItem.Properties.ByName("Qty").Value(); IPriceEach = AItem.Properties.ByName("Price Each").Value(); IPriceTotal = AItem.Properties.ByName("Price Total").Value(); oDocument.Tables[2].Cell(ItemNumber, 1).Range.Text = IQty; oDocument.Tables[2].Cell(ItemNumber, 2).Range.Text = IName; oDocument.Tables[2].Cell(ItemNumber, 3).Range.Text = IPriceEach; oDocument.Tables[2].Cell(ItemNumber, 4).Range.Text = IPriceTotal; ItemNumber++; } }
public void GetItems(PlanSwift.Item AItem) { SendToExcel(AItem); for (int ChildIndex = 0; ChildIndex <= AItem.Count - 1; ChildIndex++) { GetItems(AItem[ChildIndex]); } }
public void GetItems(PlanSwift.Item AItem) { //Gather all planswift items SendtoOutlook(AItem); for (int ChildIndex = 0; ChildIndex <= AItem.Count - 1; ChildIndex++) { GetItems(AItem[ChildIndex]); } }
public void SendToExcel(PlanSwift.Item AItem) { PlanSwift.ItemType IType; object ItemProp, IName, IQty, ITab, INumber, IPriceEach, IPriceTotal; IType = AItem.ItemType; ItemProp = AItem.Properties; ITab = TGlobal.pc.Tabs.SelectedTab().Name; IName = AItem.Name; if (AItem.ItemType == PlanSwift.ItemType.itFolder) { INumber = ""; IQty = ""; IPriceEach = ""; IPriceTotal = ""; } else { INumber = AItem.Properties.ByName("Item #").Value(); IQty = AItem.Properties.ByName("Qty").Value(); IPriceEach = AItem.Properties.ByName("Price Each").Value(); IPriceTotal = AItem.Properties.ByName("Price Total").Value(); } oSheet.Cells[i, 1] = ITab; oSheet.Cells[i, 2] = IName; oSheet.Cells[i, 3] = INumber; oSheet.Cells[i, 4] = IQty; oSheet.Cells[i, 5] = IPriceEach; oSheet.Cells[i, 6] = IPriceTotal; switch (IType) { case PlanSwift.ItemType.itNone: oSheet.Cells[i, 7] = ""; break; case PlanSwift.ItemType.itPart: oSheet.Cells[i, 7] = "Part"; break; case PlanSwift.ItemType.itAssembly: oSheet.Cells[i, 7] = "Assembly"; break; case PlanSwift.ItemType.itFolder: oSheet.Cells[i, 7] = "Folder"; break; } i++; }
public void SendtoOutlook(PlanSwift.Item AItem) { // Sub Funciton PlanSwift.ItemType ItemType; ItemType = AItem.ItemType; //ItemDigiType = AItem.DigiType; switch (ItemType) { case PlanSwift.ItemType.itFolder: FolderArry.Add("1"); break; case PlanSwift.ItemType.itAssembly: string IAssembly = AItem.Properties.ByName("Qty").Value(); AssemblyQArry.Add(IAssembly); break; case PlanSwift.ItemType.itPart: string IPart = AItem.Properties.ByName("Qty").Value(); PartQArry.Add(IPart); break; case PlanSwift.ItemType.itNone: switch (AItem.DigiType) { case 3: string ICount = AItem.Properties.ByName("Point Count").Value(); CountQArry.Add(ICount); break; case 2: string ISegment = AItem.Properties.ByName("Linear Total").Value(); SegmentQArry.Add(ISegment); break; case 1: string ILinear = AItem.Properties.ByName("Linear Total").Value(); LinearQArry.Add(ILinear); break; case 0: string IArea = AItem.Properties.ByName("Area").Value(); AreaQArry.Add(IArea); break; } break; } }
public void SendtoAutoCAD(PlanSwift.Item AItem) { PlanSwift.ISection CurrentSection; PlanSwift.INode CurrentNode; int ItemDigiType, SectionIndex, NodeIndex; double Xscale, Yscale; float nx, ny; object StartNode, EndNode; if (AItem.DigiType != 3) { ItemDigiType = AItem.DigiType; switch (ItemDigiType) { // IF Digitizer type is "Area" do something case 0: for (SectionIndex = 0; SectionIndex <= AItem.Sections.Count - 1; SectionIndex++) { CurrentSection = AItem.Sections[SectionIndex]; StartNode = CurrentSection.Nodes[0].Point; EndNode = CurrentSection.Nodes[CurrentSection.Nodes.Count - 1].Point; double[] SP = new double[((CurrentSection.Nodes.Count + 1) * 2)]; Xscale = CurrentSection.Page().ScaleX; Yscale = CurrentSection.Page().ScaleY; //Loop Though all nodes in current section for (NodeIndex = 0; NodeIndex <= CurrentSection.Nodes.Count - 1; NodeIndex++) { CurrentNode = CurrentSection.Nodes[NodeIndex]; nx = CurrentNode.x; ny = -CurrentNode.y; SP[NodeIndex * 2] = (nx / Xscale) * 12; SP[NodeIndex * 2 + 1] = (ny / Yscale) * 12; } //Close lines of the area SP[SP.Length - 2] = (CurrentSection.Nodes[0].x / Xscale) * 12; SP[SP.Length - 1] = (-CurrentSection.Nodes[0].y / Yscale) * 12; AuDocument.ModelSpace.AddLightWeightPolyline(SP); } break; } } }