22555
Automotive
- Dec 17, 2003
- 24
Hello ,
Currently I am working on a product template in 3DExperience which has Design Table. Associated excel sheet is saved in 3DX database.
Trying to create a macro to do the following task.
Open the excel sheet associated with Design table which is saved in 3DExperience database ----> Check out -----> Update the values in excel -----> Save and Check in.
In VBA below code is not working
Dim oDBSearch As DatabaseSearch
Set oDBSearch = oSearchService.DatabaseSearch
oDBSearch.BaseType = "Document"
oDBSearch.AddEasyCriteria "PLM_ExternalID", "XXXXX"
Dim oEntity 'As PLMEntity
'Set oEntity = oDBSearch.Results.Item(1)
I also tried this in EKL function, Problem is 1. Design table association is broken after running . 2.if excel sheet has 2 sheets. I could not access second sheet to update the value. Or how to do that?
Thanks in Advance
22555
***************EKL********************
let doc (PLMDMTDocument)
let query (PLMQuery)
let results (List)
let result (PLMQueryResult)
let str1(String)
query = CreatePLMQuery("PLMDMTDocument")
query->AddCriterion("PLM_ExternalID","XXXXXXXX")
results = query->RunQuery()
str1 = "Test"
if (results.Size() == 1)
{
set result = results[1]
let path (String)
set doc = result->LoadResult()
path = doc->CheckOut()
Path = path
Message(path)
let sh (DTSheetType)
sh = CreateSheet(path, "")
sh->SetCell(1, 1, "My val without read cell")
sh->CommitChanges()
doc->CheckIn(path)
PopupMessage("This instance is : ", str1)
}
else
Message("result not found")
Currently I am working on a product template in 3DExperience which has Design Table. Associated excel sheet is saved in 3DX database.
Trying to create a macro to do the following task.
Open the excel sheet associated with Design table which is saved in 3DExperience database ----> Check out -----> Update the values in excel -----> Save and Check in.
In VBA below code is not working
Dim oDBSearch As DatabaseSearch
Set oDBSearch = oSearchService.DatabaseSearch
oDBSearch.BaseType = "Document"
oDBSearch.AddEasyCriteria "PLM_ExternalID", "XXXXX"
Dim oEntity 'As PLMEntity
'Set oEntity = oDBSearch.Results.Item(1)
I also tried this in EKL function, Problem is 1. Design table association is broken after running . 2.if excel sheet has 2 sheets. I could not access second sheet to update the value. Or how to do that?
Thanks in Advance
22555
***************EKL********************
let doc (PLMDMTDocument)
let query (PLMQuery)
let results (List)
let result (PLMQueryResult)
let str1(String)
query = CreatePLMQuery("PLMDMTDocument")
query->AddCriterion("PLM_ExternalID","XXXXXXXX")
results = query->RunQuery()
str1 = "Test"
if (results.Size() == 1)
{
set result = results[1]
let path (String)
set doc = result->LoadResult()
path = doc->CheckOut()
Path = path
Message(path)
let sh (DTSheetType)
sh = CreateSheet(path, "")
sh->SetCell(1, 1, "My val without read cell")
sh->CommitChanges()
doc->CheckIn(path)
PopupMessage("This instance is : ", str1)
}
else
Message("result not found")