Using PyroCADTrans As Transaction = PyroCAD_Commands.PyroCADTransMgr.StartTransaction
Dim objTakeoff As new PipeFitting
Dim PyroCADQuery As New DataQuery()
PyroCADQuery.AddSizeParameter(Context.ConnectionSizeNominalDiameter, 1,1.0)
PyroCADQuery.PartGuid = "37914362-5B45-40EB-A0C5-8E746ABE373F"
PyroCADQuery.SubType = "Threaded Outlet"
Dim partList1 As DataPartsList = PartManager.GetPartsList(PyroCADQuery)
Dim MvPartExpandableTable As DataExpandedTable = PartManager.GetPartTable(PyroCADQuery, maxRecords)
Dim recordcol As DataRecordCollection = MvPartExpandableTable.DataRecords
Dim MvpartRecord As DataRecord = recordcol(0)
PartManager.CreatePartViaRecord(MvPartExpandableTable, MvpartRecord, objTakeoff)
Dim strLayerKey As String = objTakeoff.LayerKey
Dim dicLayerKey As New AECDBService.DictionaryLayerKeyStyle(PyroCAD_Commands.PyroCADDB)
objTakeoff.Location = “A Point on a pipe”
'Finally we will add the union to the database ands commit the transaction
Dim bt As BlockTable = CType(PyroCAD_Commands.PyroCADDB.TransactionManager.GetObject(PyroCAD_Commands.PyroCADDB.BlockTableId, OpenMode.ForRead, False), BlockTable)
Dim btr As BlockTableRecord = CType(PyroCAD_Commands.PyroCADDB.TransactionManager.GetObject(bt(BlockTableRecord.ModelSpace), OpenMode.ForWrite, False), BlockTableRecord)
btr.AppendEntity(objTakeoff)
PyroCAD_Commands.PyroCADDB.TransactionManager.AddNewlyCreatedDBObject(objTakeoff, True)
PyroCADTrans.Commit()
iam getting the takeoff inserted to the insertion point which i given , the entire takeoff go inside the pipe. but it is not like when we manually inserted, when manually inserted it connection point attach to the pipe curve but insertion point will at the edge of the pipe.