3DCADWorld Network | 3DCADTips | 3DCADTutorials | 3DCADForums | 3DCADSearch | 3DCADBooks | Design World






Get CAD tips and tutorials on your desktop when you register at 3DCADTips.com!

3DCADTips Weekly
Latest Issue
Archive

3DCADTips Forum Update
Latest Issue
Archive






Visit 3DCADSearch.com - The CAD & Graphics Search Engine!!




  #1 (permalink)  
Old January 31st, 2008, 12:59 AM
ronaldvandenbroek ronaldvandenbroek is offline
Junior Member
 
Join Date: Jan 2008
Location: The Netherlands
Posts: 5
Unhappy Ghost elements

Question...

I'm having troubles with a large number elements present on 1 layer...
The layer ount shows them to be there, but I can't see them. The elements aren't hidden.
If I fit my view, my model is thrown so far back I can't see it anymore. (so there must be objects present which are far away from my model)

I've performed a part cleanup (delete empty groups,delete unused objects,delete unused fonts, etc) but this doesn't make a difference. The objects are still there.
If I have fitted my view and try to delete them, it says no objects selected.

I'm at a loss ..Anybody have a solution for this? How do I get ridd of these ghost objects...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Link


  #2 (permalink)  
Old January 31st, 2008, 07:37 AM
jrawlinson@socal.rr.com jrawlinson@socal.rr.com is offline
Junior Member
 
Join Date: Sep 2006
Posts: 3
Talking Try a couple of things

There are several reasons why your elements may be hidden. You say they are on layer 1, so it's not a layer issue, but they could also be blanked. There are several commands that automatically blank entities.

Try this:

SAVE YOUR FILE

On you Keyboard, HIT Control-Shift and U (This is a shortcut for unblank all).

If that did not work, the entities may be hidden, look at your part navigator and see if you find a bunch of grayed out entities. If so, RMB on these and select show.

Hope one of these helps

Jim Rawlinson
Sr. Engineer CAD/PLM Support
Goodrich SIS California
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old February 8th, 2008, 04:23 AM
ronaldvandenbroek ronaldvandenbroek is offline
Junior Member
 
Join Date: Jan 2008
Location: The Netherlands
Posts: 5
Default

Quote:
Originally Posted by jrawlinson@socal.rr.com View Post
There are several reasons why your elements may be hidden. You say they are on layer 1, so it's not a layer issue, but they could also be blanked. There are several commands that automatically blank entities.

Try this:

SAVE YOUR FILE

On you Keyboard, HIT Control-Shift and U (This is a shortcut for unblank all).

If that did not work, the entities may be hidden, look at your part navigator and see if you find a bunch of grayed out entities. If so, RMB on these and select show.

Hope one of these helps

Jim Rawlinson
Sr. Engineer CAD/PLM Support
Goodrich SIS California

Thanx Jim...

Like I said the objects aren't invisible.They also aren't blanked.
As far as I can tell they originated from an imported / converted DXF. Apperently this action inherets some objects which NX doesn't know how to handle..

I have found a script to remove everything from a layer including these so called "Ghost Elements"

Watch out!! everything is removed, so place everything you want to keep on another layer..
Code needs to be compiled within an NX project in C++

Code:
/*HEAD DELETE_ALL_OBJECTS_ON_LAYER CCC UFUN */
#include 
#include 
#include 
#include 
#include 
#include 
#include 

#define UF_CALL(X) (report_error( __FILE__, __LINE__, #X, (X)))

static int report_error( char *file, int line, char *call, int irc)
{
    if (irc)
    {
        char err[133],
             msg[133];

        sprintf(msg, "*** ERROR code %d at line %d in %s:\n+++ ",
            irc, line, file);
        UF_get_fail_message(irc, err);

    /*  NOTE:  UF_print_syslog is new in V18 */

        UF_print_syslog(msg, FALSE);
        UF_print_syslog(err, FALSE);
        UF_print_syslog("\n", FALSE);
        UF_print_syslog(call, FALSE);
        UF_print_syslog(";\n", FALSE);

        if (!UF_UI_open_listing_window())
        {
            UF_UI_write_listing_window(msg);
            UF_UI_write_listing_window(err);
            UF_UI_write_listing_window("\n");
            UF_UI_write_listing_window(call);
            UF_UI_write_listing_window(";\n");
        }
    }

    return(irc);
}

static void set_layer_active(int layer)
{
    UF_CALL(UF_LAYER_set_status(layer, UF_LAYER_ACTIVE_LAYER));
}

static int allocate_memory(unsigned int nbytes, void **where)
{
    int
        resp;

    *where = UF_allocate_memory(nbytes, &resp);

    return resp;
}

static int make_an_array(uf_list_p_t *object_list, tag_t **objects)
{
    int
        ii,
        n;
    uf_list_p_t
        temp;

    UF_CALL(UF_MODL_ask_list_count(*object_list, &n));

    UF_CALL(allocate_memory(n * sizeof(tag_t), (void **)objects));

    for (ii = 0, temp = *object_list; ii < n; temp = temp->next, ii++)
        (*objects)[ii] = temp->eid;

    UF_CALL(UF_MODL_delete_list(object_list));

    return n;
}

static int ask_all_objects_on_layer(int layer, tag_t **objects)
{
    tag_t
        object = NULL_TAG;
    uf_list_p_t
        list;

    UF_CALL(UF_MODL_create_list(&list));

    while (!UF_CALL(UF_LAYER_cycle_by_layer(layer, &object)) &&
        (object != NULL_TAG)) UF_CALL(UF_MODL_put_list_item(list, object));

    return make_an_array(&list, objects);
}

#ifndef UF_LAYER_MAX_LAYER
    #define UF_LAYER_MAX_LAYER 256
#endif

static logical prompt_for_a_layer(char *prompt, char *item, int *number)
{
    int
        irc,
        resp;
    char
        laymsg[100],
        menu[1][16];
    int
        da[1];

    strcpy(&menu[0][0], item);
    da[0] = *number;

    resp = uc1607(prompt, menu, 1, da, &irc);
    if (resp == 3 || resp == 4)
    {
        *number = da[0];
        if ((*number > UF_LAYER_MAX_LAYER) || (*number <= 0))
        {
            sprintf(laymsg, "Layers range from 1 to %d", UF_LAYER_MAX_LAYER);
            uc1601(laymsg, TRUE);
            return prompt_for_a_layer(prompt, item, number);
        }
        return TRUE;
    }
    else return FALSE;
}

static void do_it(void)
{
    int
        layer = 1,
        n_objs;
    tag_t
        *objs;
    char
        messg[133];

    while (prompt_for_a_layer("Delete objects from", "Layer", &layer))
    {
        set_layer_active(layer);

        n_objs = ask_all_objects_on_layer(layer, &objs);
        if (n_objs > 0)
        {
            UF_CALL(UF_OBJ_delete_array_of_objects(n_objs, objs, NULL));
            UF_free(objs);
        }
        else
        {
            sprintf(messg, "\nNo objects found on layer %d",layer);
            uc1601(messg,1);
        }
    }
}

/*ARGSUSED*/
void ufusr(char *param, int *retcode, int paramLen)
{
    if (UF_CALL(UF_initialize())) return;
    do_it();
    UF_terminate();
}

int ufusr_ask_unload(void)
{
    return (UF_UNLOAD_IMMEDIATELY);
}
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -6. The time now is 06:43 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0