0 Members and 1 Guest are viewing this topic.
I was digging into this a while back, similar to what you are wanting to do, report out the material by code. What I found, that code is only accessible through Nest Reports and after nesting, using the Sheet Product Code print object. Doesn't really work with anything decoiled since it's not nesting.
Quote from: bobcat09 on Jul 12, 2019, 14:07:04 PMI was digging into this a while back, similar to what you are wanting to do, report out the material by code. What I found, that code is only accessible through Nest Reports and after nesting, using the Sheet Product Code print object. Doesn't really work with anything decoiled since it's not nesting.This information needs to be available in the Item reports as well. It not being there is, well, stupid. Or maybe shortsighted is a better description.
Has anyone sifted through the API to see if this is accessible? IF not I'm going to start.
CombinedItemNo_PartNo_Devs 917 DevelopmentBlankSize 430 DevelopmentFillerPartFlag 5331 DevelopmentHeight 431 DevelopmentPartIndex 5189 DevelopmentRotaryDiameter 915 DevelopmentWidth 432 PartBendingInformation 360 PartDevelopmentName 114 PartInsulationFlag 186 PartMaterialAbrv 182 PartMaterialDenity 255 PartMaterialGauge 183 PartMaterialStandard 5138 PartNameIndex 5177 PartNoInItem 21 PartQty 208 PartSkinFlag 5048 PartUserDefinedField 5464 DevelopmentMaterialGauge 909 DevelopmentMaterial 910 DevelopmentWeight 907 DevelopmentArea 902 DevelopmentBaseQty 903 DevelopmentNestedQty 904 DevelopmentGauge 911 DevelopmentInsulationFlag 908 DevelopmentDefaultSheetSize 913 DevelopmentExportFilename 912 DevelopmentPartBendingInformation 918
public void GetMaterialProdID() { Document doc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument; Autodesk.AutoCAD.DatabaseServices.Database curDB = doc.Database; Editor ed = doc.Editor; using (Transaction trans = curDB.TransactionManager.StartTransaction()) { PromptSelectionResult acSSPrompt = ed.GetSelection(); if (acSSPrompt.Status == PromptStatus.OK) { SelectionSet acSSet = acSSPrompt.Value; foreach (SelectedObject acSSObj in acSSet) { if (acSSObj != null) { Entity acEnt = trans.GetObject(acSSObj.ObjectId, OpenMode.ForRead) as Entity; if (acEnt != null) { Item myItem = Job.GetFabricationItemFromACADHandle(acEnt.Handle.ToString()); if (myItem != null) { ed.WriteMessage("This if then is working!!!"); string materialCode = myItem.Material.Id.ToString(); ed.WriteMessage(myItem.Material.ToString()); ed.WriteMessage(myItem.Material.Gauges.ToString()); ed.WriteMessage(myItem.Ancillaries.ToString()); ed.WriteMessage(myItem.Material.Source.ToString()); ed.WriteMessage(myItem.Material.Name.ToString()); } } } } trans.Commit(); } } }