PdcProjectLineList.AddArticle: Difference between revisions

From External Bemet Wiki
Jump to navigation Jump to search
No edit summary
 
Line 11: Line 11:
This code example creates a new project, adds a new article to the project and converts it to a calculation.
This code example creates a new project, adds a new article to the project and converts it to a calculation.


<source lang="vb">
<source lang="VB.Net">
dim objProject
dim project as pdcEXT.IProject
dim objProjectLine
dim projectLine as pdcEXT.IProjectLine
dim strMatNo
dim materialNumber as string
    
    
   strMatNo                          = "ABC123"
   materialNumber = "ABC123"
   set objProject                    = pdc.projects.new
   project = PDC.App.Projects.New
   objProject.SetCustomerNo           "12345"
   project.SetCustomerNo("12345")
   set objProjectLine                = objProject.ProjectLineList.AddArticle(strMatNo)
   projectLine = project.ProjectLineList.AddArticle(materialNumber)
   objProject.ArticlesToCalculations                     
   project.ArticlesToCalculations()                    
    
    
   objProject.Save
   project.Save
   objProject.Show
   project.Show
  System.Runtime.InteropServices.Marshal.FinalReleaseComObject(projectLine)
  System.Runtime.InteropServices.Marshal.FinalReleaseComObject(project)
</source>
</source>


== Availability ==
== Availability ==
Available since February 2011 (From version 4.2 onwards).
Available since February 2011 (From version 4.2 onwards).

Latest revision as of 13:56, 2 August 2023

Declaration

AddArticle(ArtNo as String) as PdcProjectLine

Description

Notes

Code example

This code example creates a new project, adds a new article to the project and converts it to a calculation.

dim project as pdcEXT.IProject
dim projectLine as pdcEXT.IProjectLine
dim materialNumber as string
  
  materialNumber = "ABC123"
  project = PDC.App.Projects.New
  project.SetCustomerNo("12345")
  projectLine = project.ProjectLineList.AddArticle(materialNumber)
  project.ArticlesToCalculations()                    
  
  project.Save
  project.Show
  System.Runtime.InteropServices.Marshal.FinalReleaseComObject(projectLine)
  System.Runtime.InteropServices.Marshal.FinalReleaseComObject(project)

Availability

Available since February 2011 (From version 4.2 onwards).