• Hi,

    Please see the macro below on how the execution can be completed.
    I want to run the !confirm whenever I choose YES or NO in !update.

    !update = !!Alert.Confirm('Update Drawings?')
    if (!update EQ 'YES') then
    UPDATE ALL
    [COLOR=#ff0000]????????????????[/COLOR]


    elseif (!update EQ 'NO')then

    !confirm = !!Alert.Confirm('Proceed to Extraction?')
    if (!confirm EQ 'YES') then
    var !sheet collect all SHEE for CE
    do !x from 1 to !sheet.size()
    $!sheet[$!x]
  • This will work
    !update = !!Alert.Confirm('Update Drawings?')


    if (!update eq 'YES') then
    $p UPDATE ALL
    else
    !confirm = !!Alert.Confirm('Proceed to Extraction?')
    if (!confirm eq 'YES') then
     var !sheets collect all SHEE for CE
     do !sheet values !sheets
      $!sheet
     enddo
    endif
    endif


  • [COLOR=#333333]Replace UPDATE ALL instead '[/COLOR][COLOR=#ff0000]$p [/COLOR][COLOR=#333333]UPDATE ALL'. I added to comment it[/COLOR]
  • I am not getting any error, but when I choose YES to update, it is not updating.
    Kindly check, below is the the complete macro, please give it a try.
    Thank you!

    !update = !!Alert.Confirm('Update Drawings?')
    if (!update EQ 'YES') then
    $p UPDATE ALL
    else

    !confirm = !!Alert.Confirm('Proceed to Extraction?')
    if (!confirm EQ 'YES') then
    var !sheet collect all SHEE for CE
    do !x from 1 to !sheet.size()
    $!sheet[$!x]

    !dir = 'C:\temp\'
    !filename = !dir + !!CE.NamN.Replace('/','.').Replace('\','.') + '.dwg'


    $m/%pdmsexe%\full_dxf.mac


    LIEXEC /Draft_DWG_LI 'R21' CONFIGDATA 'full_dxf' OutputFileName '$!fileName'
    enddo


    elseif (!confirm EQ 'NO')then
    !!Alert.Message('Extraction Aborted!')
    return
    endif
    endif


    !!Alert.Message('Successfully Extracted!')
  • I replaced line [COLOR=#FF0000]$p UPDATE ALo [/COLOR][COLOR=#008000]UPDATE ALL [/COLOR]to:
    [COLOR=#333333]!update = !!Alert.Confirm('Update Drawings?')[/COLOR]
    [COLOR=#333333]if (!update EQ 'YES') then
    [/COLOR][COLOR=#ff0000]--$p UPDATE ALL[/COLOR]
    [COLOR=#333333]UPDATE ALL[/COLOR]
    [COLOR=#333333]else[/COLOR]

    [COLOR=#333333]!confirm = !!Alert.Confirm('Proceed to Extraction?')[/COLOR]
    [COLOR=#333333]if (!confirm EQ 'YES') then[/COLOR]
    [COLOR=#333333]var !sheet collect all SHEE for CE[/COLOR]
    [COLOR=#333333]do !x from 1 to !sheet.size()[/COLOR]
    [COLOR=#333333]$!sheet[$!x][/COLOR]

    [COLOR=#333333]!dir = 'C:\temp\'[/COLOR]
    [COLOR=#333333]!filename = !dir + !!CE.NamN.Replace('/','.').Replace('\','.') + '.dwg'[/COLOR]


    [COLOR=#333333]$m/%pdmsexe%\full_dxf.mac[/COLOR]


    [COLOR=#333333]LIEXEC /Draft_DWG_LI 'R21' CONFIGDATA 'full_dxf' OutputFileName '$!fileName'[/COLOR]
    [COLOR=#333333]enddo[/COLOR]


    [COLOR=#333333]elseif (!confirm EQ 'NO')then[/COLOR]
    [COLOR=#333333]!!Alert.Message('Extraction Aborted!')[/COLOR]
    [COLOR=#333333]return[/COLOR]
    [COLOR=#333333]endif[/COLOR]
    [COLOR=#333333]endif[/COLOR]


    [COLOR=#333333]!!Alert.Message('Successfully Extracted!')[/COLOR]
  • [QUOTE=MarvinGonda1988;97294]I am not getting any error, but when I choose YES to update, it is not updating.
    Kindly check, below is the the complete macro, please give it a try.
    Thank you!

    !update = !!Alert.Confirm('Update Drawings?')
       if (!update EQ 'YES') then
       $p UPDATE ALL
       else
       
    !confirm = !!Alert.Confirm('Proceed to Extraction?')
       if (!confirm EQ 'YES') then
       var !sheet collect all SHEE for CE
       do !x from 1 to !sheet.size()
       $!sheet[$!x]
       
    !dir = 'C:\temp\'
    !filename = !dir + !!CE.NamN.Replace('/','.').Replace('\','.') + '.dwg'


    $m/%pdmsexe%\full_dxf.mac


    LIEXEC /Draft_DWG_LI 'R21' CONFIGDATA 'full_dxf' OutputFileName '$!fileName'
    enddo


       elseif (!confirm EQ 'NO')then
       !!Alert.Message('Extraction Aborted!')
       return
    endif
    endif


    !!Alert.Message('Successfully Extracted!')


    [COLOR=#333333]!update = !!Alert.Confirm('Update Drawings?')[/COLOR]
    [COLOR=#333333]if (!update EQ 'YES') then
    [/COLOR]var !draws coll all draw for ce
    do !i indices !draws
    $!draws[$!i]
    [COLOR=#333333]UPDATE ALL
    [/COLOR]enddo
    [COLOR=#333333]else[/COLOR]