• This forum is the machine-generated translation of www.cad3d.it/forum1 - the Italian design community. Several terms are not translated correctly.

ilogic update properties by excel

  • Thread starter Thread starter Bustrek
  • Start date Start date

Bustrek

Guest
hello to all
I have a question for ilogic, premise I am not able to program in ilogic and nemmo in vb, but stealing in here and a couple of strings I set up a code to update the properties of the files by reading them from excel, all starting from a file together. the only thing that doesn’t work and that always loads me the data line of the starting axieme code and not the files that opens me.
if someone has some info I thank you in advance.
I attach the code:

dim odoc as document = thisapplication.activedocument
dim adoc as documentsnumerator = odoc. allreferenceddocuments
dim idoc as document
dim xdoc as document
for each idoc in adoc
xdoc = thisapplication.documents.open(idoc.fullfilename, true) 'false means it will open invisible

startrule:
'read the excel file
'goexcel.open ("c:\users\michele\onedrive\documenti\codifica salvamac.xlsx","sheet1")
goexcel.open("c:\ut\prg\salvamac\p100\bom p100003.xlsx", "bom")
' Row index from 2 to 10000
for rowpn = 2 to 10000
'Find the first blank cell in column a
if (goexcel.cellvalue("e" & rowpn) = thisdoc.filename) then
'creates a variable for the lower cell value of a row
'The empty cell line
lastpn = goexcel.cellvalue("e" & rowpn)
lastdesc = goexcel.cellvalue("f" & rowpn)
dse = goexcel.cellvalue("ae" & rowpn)
date = goexcel.cellvalue("g" & rowpn)
dev = goexcel.cellvalue("h" & rowpn)
snq = goexcel.cellvalue("i" & rowpn)
rah = goexcel.cellvalue("j" & rowpn)
mat = goexcel.cellvalue("p" & rowpn)
fom = goexcel.cellvalue("q" & rowpn)
trf = goexcel.cellvalue("r" & rowpn)
tri = goexcel.cellvalue("ag" & rowpn)
gdp = goexcel.cellvalue("s" & rowpn)
cat = goexcel.cellvalue("m" & rowpn)
tar = goexcel.cellvalue("k" & rowpn)
lav = goexcel.cellvalue("n" & rowpn)
tap = goexcel.cellvalue("o" & rowpn)
fn = goexcel.cellvalue("l" & rowpn)
r1d = goexcel.cellvalue("t" & rowpn)
r1t = goexcel.cellvalue("u" & rowpn)
r1a = goexcel.cellvalue("v" & rowpn)
r2d = goexcel.cellvalue("w" & rowpn)
r2t = goexcel.cellvalue("x" & rowpn)
r2a = goexcel.cellvalue("y" & rowpn)
r3d = goexcel.cellvalue("z" & rowpn)
r3t = goexcel.cellvalue("aa" & rowpn)
r3a = goexcel.cellvalue("ab" & rowpn)
nte = goexcel.cellvalue("ac" & rowpn)
ssc = goexcel.cellvalue("ad" & rowpn)
exit for
end if
next
'check if the code number is equal to the file name or is empty
if iproperties.value("project", "part number") = thisdoc.filename(false) _
or iproperties.value("project", "part number") = "" then
' iproperty tax on the bed value from excel
iproperties.value("project", "part number") = lastpn
iproperties.value("project", "description") = lastdesc
iproperties.value("custom", "description") = dse
iproperties.value("custom", "data") = date
iproperties.value("custom", "derived by") = dev
iproperties.value("custom", "unquoted bevels") = snq
iproperties.value("custom", "rugosita' ra") = rah
iproperties.value("custom", "material") = mat
iproperties.value("custom", "material shape") = fom
iproperties.value("custom", "final processing") = trf
iproperties.value("custom", "intermediate treatment") = tri
iproperties.value("custom", "grade accuracy") = gdp
iproperties.value("custom", "category") = cat
iproperties.value("custom", "type article") = tar
iproperties.value("custom", "work") = lav
iproperties.value("custom", "type appov. primary") = tap
iproperties.value("custom", "supplier") = fon
iproperties.value("custom", "r01_data") = r1d
iproperties.value("custom", "r01_testo") = r1t
iproperties.value("custom", "r01_author") = r1a
iproperties.value("custom", "r02_data") = r2d
iproperties.value("custom", "r02_text") = r2t
iproperties.value("custom", "r02_author") = r2a
iproperties.value("custom", "r03_data") = r3d
iproperties.value("custom", "r03_testo") = r3t
iproperties.value("custom", "r03_author") = r3a
iproperties.value("custom", "note") = nte
iproperties.value("custom", "replaces") = ssc

end if
'show and asks to confirm the results
question = messagebox.show("code: " & lastpn & vblf _
&"description: " & lastdesc & vblf _
& "Are they correct?", "excel property", messageboxbuttons.yesno )
'if the answer is no
if question = vbno then
'delete these iproperties tested ok
iproperties.value("project", "part number") = "
iproperties.value("project", "description") = "
iproperties.value("custom", "description") = "
iproperties.value("custom", "data") = "
iproperties.value("custom", "derived by") = "
iproperties.value("custom", "unquoted bevels") = "
iproperties.value("custom", "rugosita' ra") = ""
iproperties.value("custom", "material") = "
iproperties.value("custom", "material shape") = ""
iproperties.value("custom", "data") = "
iproperties.value("custom", "final treatment") = ""
iproperties.value("custom", "intermediate treatment") = ""
iproperties.value("custom", "grade accuracy") = ""
iproperties.value("custom", "category") = ""
iproperties.value("custom", "type article") = ""
iproperties.value("custom", "work") = "
iproperties.value("custom", "type appov. primary") = ""
iproperties.value("custom", "supplier") = ""
iproperties.value("custom", "r01_data") = ""
iproperties.value("custom", "r01_testo") = ""
iproperties.value("custom", "r01_author") = ""
iproperties.value("custom", "r02_data") = ""
iproperties.value("custom", "r02_text") = ""
iproperties.value("custom", "r02_author") = ""
iproperties.value("custom", "r03_data") = ""
iproperties.value("custom", "r03_text") = ""
iproperties.value("custom", "r03_author") = ""
iproperties.value("custom", "note") = ""
iproperties.value("custom", "replaces") = ""
Run the rule again
goto startrule
'if the answer is yes exit rule
else end if

'ilogicvb.runexternalrule('properties')
'xdoc. save
xdoc.close(true)
next
 

Forum statistics

Threads
44,997
Messages
339,767
Members
4
Latest member
ibt

Members online

No members online now.
Back
Top