cancel
Showing results for 
Search instead for 
Did you mean: 

Not able to delete section curves which makes thrucurve

Creator
Creator

Hi All,

 

I have thrucurve feature, i need to delete this feaure along with the section curves which makes this. i am facing challenges in deleting the curves which make up this feature and delete it.

Please advice me if you have any solution for this.

 

 

i tried different way.one is below

 

Ufs.Modl.AskThruCurves1(feat,out s_section, out s_spine, out patch, out alignment, value, out vdegree, out vstatus, out body_type, tol, out c_face_id, c_flag);

 

 

 

int num = s_section.num;

 

 

List<Tag> lAddtoDeleteList = new List<Tag>();

 

 

for (int i = 0; i < num; i++)

{

 

 

Tag lnTag = s_section.id[i];

lAddtoDeleteList.Add(lnTag);

}

 

4 REPLIES

Re: Not able to delete section curves which makes thrucurve

Phenom
Phenom
You don't show the full code, particularly how you are deleting the feature. But I suspect you are trying to delete the curves that define the feature before you have first deleted the feature itself.
I've had situations like this where NX simply ignores delete requests if the objects being deleted are used by a feature.
Graham Inchley Snr R&D Engineer (Systems Development), Sandvik Coromant
Lenovo ThinkPad W540, Win7, 16GB. Developing in: Java | C | C# | KF
Production: NX8.5.3.3 MP11 64bit Testing: NX9.0.2.5

Re: Not able to delete section curves which makes thrucurve

Creator
Creator

Hi Inch, Thanks for your reply.

i have showed the way i am collecting tags from StringList.

 

The problem here is that i was not able to identify and highlight the curves which makes stringlist.

it is giving me the correct count of Line tags but when i ask it's type and subtype

 

it is giving me  type as UF_smart_container_type and subtype as

UF_smart_sc_section_subtype

 

int num = s_section.num;

List<Tag> lAddtoDeleteList = new List<Tag>();

 for (int i = 0; i < num; i++)

{

   Tag lnTag = s_section.id[i];

     lAddtoDeleteList.Add(lnTag);

}

 

 

As you have mentioned here.yes we have to delete the thrucurve feature first and then the section's which makes that.

 

i can get the sectionlist but not able to get the curves which makes sectionlist.

 

Thanks

 

 

Re: Not able to delete section curves which makes thrucurve

Phenom
Phenom

Not sure quite why you are getting that type and subtype, but I think there is a problem with your array indices. The documentation for UF_STRING_t that you use for the second parameter of UF_MODL_ask_thru_curves1() states that the member num defines the number of items in the string and dir arrays. But I think the id member is an array as large as the total number of items indicated in string.

Your code iterates over id using num as the terminator, but I think it should use the sum of all the string members as the terminator.

I found an example of reporting the contents of a string list on the solution centre. Maybe you can convert this to C# (is that what you are coding in?). It might help explain what is in the string list in your code:

static void report_string_list_info(char *name, UF_STRING_t *string)
{
    int
        ii,
        jj,
        kk = 0;
    double
        loc[3];
    char
        msg[133];

    sprintf(msg, "%s->num = %d\n", name, string->num);
    WRITE(msg);
    for (ii = 0; ii < string->num; ii++)
    {
        sprintf(msg, "%s->string[%d] = %d\n", name, ii, string->string[ii]);
        WRITE(msg);
        sprintf(msg, "%s->dir[%d] = %d\n", name, ii, string->dir[ii]);
        WRITE(msg);
        if (string->dir[ii] == UF_MODL_CURVE_START_FROM_BEGIN)
            show_curve_direction(string->id[kk]);
        else
            show_curve_flip_direction(string->id[kk]);
        for (jj = 0; jj < string->string[ii]; jj++)
        {
            sprintf(msg, "%s->id[%d] = %d\n", name, kk, string->id[kk]);
            WRITE(msg);
            sprintf(msg, "%d", kk);
            if (UF_OBJ_ask_name_origin(string->id[kk], loc))
            {
                UF_CALL(UF_OBJ_set_name(string->id[kk], "X"));
                UF_CALL(UF_OBJ_ask_name_origin(string->id[kk], loc));
                UF_CALL(UF_OBJ_delete_name(string->id[kk]));
            }
            display_temporary_text(msg, loc);
            UF_CALL(UF_DISP_set_highlight(string->id[kk], TRUE));
            kk++;
        }
        sprintf(msg, "%d string curves highlighted", string->string[ii]);
        uc1601(msg, TRUE);
        UF_CALL(UF_PART_cleanup(UF_PART_cleanup_highlight));
    }
}

 

Graham Inchley Snr R&D Engineer (Systems Development), Sandvik Coromant
Lenovo ThinkPad W540, Win7, 16GB. Developing in: Java | C | C# | KF
Production: NX8.5.3.3 MP11 64bit Testing: NX9.0.2.5

Re: Not able to delete section curves which makes thrucurve

Creator
Creator

Thanks for your suggesation.

this problem is resolved with your solution