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

aggregate parts with the same name

  • Thread starter Thread starter painaz
  • Start date Start date

painaz

Guest
we imagine having this starting situation:
ass_01.webpwith this list parts:
lista_01.webpnow geared the big toothed wheel:
illumino.webpI would like to write a macro that flows the list parts, locates the part with the same daughter name of the front1 view
and the aggregate obtaining this result:
unifico.webpnow the macro would have written it, to reread it should work, instead it fails:

define unified

local line_tabella
local name_parte_current
local id_parte_current
local name_part_confront
local id_parte_confrontolocal list_parti


edit_part '.
inq
le nome_parte_current (inq 301)
le nome_parte_current (trim name_parte_current)
le nome_parte_current (substr name_parte_current 1 8)

inq
(inq 302)
(ii)

pb_ltab_update

le list_parti 'pbt_ltab'
let line_tabella 1

loop
le linea_tabella (riga_tabella+1)
exit_if (rega_tabella>(ltab_rows list_parts))
let name_part_comparison (read_ltab list_parts line_tabella 1)
let name_part_comparison (trim name_part_confront)
le nome_parte_confronto (substr name_parte_confronto 1 8)
le id_parte_confronto (read_ltab list_parti riga_tabella 2)
(iii)

if (id_parte_current < id_part_face)
if (name_part_current = name_part_confront)
edit_part top
gather id_parte_confront
edit_part id_parte_current
gather id_parte_confront
smash_subpart id_part_confront
pb_ltab_update
le list_parti 'pbt_ltab'


let line_tabella (rega_tabella + 1)
end_loop
end
end
edit_part top
end

if someone has suggestions....
 
found... can always serve others so the place:

define unified

local line_tabella

local name_parte_current
local id_parte_current
local id_parte_current_num

local name_part_confront
local id_parte_confront
local id_parte_confront_num

local list_parts

inq
le nome_parte_current (inq 301)
le nome_parte_current (trim name_parte_current)
{the name_part_current(substr name_part_current 1 8)}

inq
(inq 302)
le id_parte_current (str "~"+id_parte_current)
(c)

edit_part top

pb_ltab_update
le list_parti 'pbt_ltab'
le riga_tabella (1)

while (line_tabella <= ltab_rows "pbt_ltab" )
le nome_parte_confronto (read_ltab "pbt_ltab" line_tabella 1)
let name_part_comparison (trim name_part_confront)
{let name_part_comparison (substr name_part_confront 1 8)}
le id_parte_confronto (read_ltab "pbt_ltab" line_tabella 2)
(number id_part_confront_number (number id_part_confront_str)
if (id_parte_current = id_part_confront)
{ display ("=") }

{ display ("in else") }
{display(id_parte_current) }
{display(id_part_confront) }
{display (part_current name) }
{display (part_name_confront) }
if (name_part_current = name_part_confront)
trap_error
{ display ("unifi") }
edit_part top
gather id_parte_confront
edit_part id_parte_current
gather id_parte_confront
smash_subpart id_part_confront


let line_tabella (rega_tabella + 1)
end_
edit_part top
end
 

Forum statistics

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

Members online

No members online now.
Back
Top