Need macro for merging multiple SUBE's

 
Parents
  • with orientation

    !isNew = !!Alert.Confirm('Create new SUBE - YES, Use existing one - NO')
    if (!isNew EQ 'YES') then
     if (!!CE.Type NEQ 'EQUI') then
    !!alert.Message('You have to be located on EQUI to create new SUBE')
       return
     endif
    endif
    if (!isNew EQ 'NO') then
     if (!!CE.Type NEQ 'SUBE') then
        !!alert.Message('You have to be located on SUBE where you want to move other primitives')    return
     endif
    endif
    --keep names
    !getCERefno = !!CE.Refno.String()
    !getOwnerName = !!CE.Owner.Name
    --get collection
    if (!isNew EQ 'YES') then
     VAR !getOtherSube COLLECT ALL SUBE FOR $!getCERefno
    endif
    if (!isNew EQ 'NO') then
     VAR !getOtherSube COLLECT ALL SUBE WITH ( REFNO NEQ $!getCERefno ) FOR $!getOwnerName
    endif
    !getMems = object array()
    !getMems.Clear()
    !getPos = object array()
    !getPos.Clear()
    !getOri = object array()
    !getOri.Clear()
    do !x from 1 to !getOtherSube.Size()
      $!getOtherSube[$!x]
      VAR !getMems APPEND EVAL ( STRING( REFNO ) ) FOR ALL ( SUBE MEM ) FOR CE
      VAR !getPos APPEND EVAL ( STRING ( POS WRT /* ) ) FOR ALL ( SUBE MEM ) FOR CE
      VAR !getOri APPEND EVAL ( STRING ( ORI WRT /* ) ) FOR ALL ( SUBE MEM ) FOR CE
     
    enddo
    $!getCERefno
    if (!isNew EQ 'YES') then
     NEW SUBE
    endif
    do !x from 1 to !getMems.Size()
     INCLUDE $!getMems[$!x]
     $!getMems[$!x]
     POSITION $!getPos[$!x] WRT WORLD
     ORIENTATION $!getOri[$!x] WRT WORLD
     OWNER
     
    enddo
    !isDelete = !!Alert.Confirm('Delete empty SUBEs?')
    if (!isDelete EQ 'YES') then
     do !x from 1 to !getOtherSube.Size()
      $!getOtherSube[$!x]
      DELETE SUBE
     enddo
    endif
    $!getCERefno

Reply
  • with orientation

    !isNew = !!Alert.Confirm('Create new SUBE - YES, Use existing one - NO')
    if (!isNew EQ 'YES') then
     if (!!CE.Type NEQ 'EQUI') then
    !!alert.Message('You have to be located on EQUI to create new SUBE')
       return
     endif
    endif
    if (!isNew EQ 'NO') then
     if (!!CE.Type NEQ 'SUBE') then
        !!alert.Message('You have to be located on SUBE where you want to move other primitives')    return
     endif
    endif
    --keep names
    !getCERefno = !!CE.Refno.String()
    !getOwnerName = !!CE.Owner.Name
    --get collection
    if (!isNew EQ 'YES') then
     VAR !getOtherSube COLLECT ALL SUBE FOR $!getCERefno
    endif
    if (!isNew EQ 'NO') then
     VAR !getOtherSube COLLECT ALL SUBE WITH ( REFNO NEQ $!getCERefno ) FOR $!getOwnerName
    endif
    !getMems = object array()
    !getMems.Clear()
    !getPos = object array()
    !getPos.Clear()
    !getOri = object array()
    !getOri.Clear()
    do !x from 1 to !getOtherSube.Size()
      $!getOtherSube[$!x]
      VAR !getMems APPEND EVAL ( STRING( REFNO ) ) FOR ALL ( SUBE MEM ) FOR CE
      VAR !getPos APPEND EVAL ( STRING ( POS WRT /* ) ) FOR ALL ( SUBE MEM ) FOR CE
      VAR !getOri APPEND EVAL ( STRING ( ORI WRT /* ) ) FOR ALL ( SUBE MEM ) FOR CE
     
    enddo
    $!getCERefno
    if (!isNew EQ 'YES') then
     NEW SUBE
    endif
    do !x from 1 to !getMems.Size()
     INCLUDE $!getMems[$!x]
     $!getMems[$!x]
     POSITION $!getPos[$!x] WRT WORLD
     ORIENTATION $!getOri[$!x] WRT WORLD
     OWNER
     
    enddo
    !isDelete = !!Alert.Confirm('Delete empty SUBEs?')
    if (!isDelete EQ 'YES') then
     do !x from 1 to !getOtherSube.Size()
      $!getOtherSube[$!x]
      DELETE SUBE
     enddo
    endif
    $!getCERefno

Children