- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
save and restore surface
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
07-09-2009 07:51 PM
Hi,
Could anyone please tell me whether it is possible to save and restore a spline object in SAVE_DEF and RESTORE_DEF. If so how can it be done?
Thanks,
kumar.
Re: save and restore surface
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
07-10-2009 08:50 AM
Re: save and restore surface
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
07-10-2009 10:56 AM
Hi,
Thanks for your quick response. I am relatively new to the attributes, so forgive me if my explanation is not clear enough.
We have a derived attribute named say ATTRIB_X placed on some faces. The attribute contains a pointer to a spline. I need to save that spline when saving the body and recreate the spline while opening. I tried to call spline::save () from with in SAVE_DEF where all the other data in the attribute are being saved. That call seems to be working.
But I am not sure how to restore the spline in RESTORE_DEF.
Please let me know if you need additional information.
Thanks,
kumar.
Re: save and restore surface
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
07-10-2009 11:27 AM
Hi Kumar,
I talked with Yogesh and there are a few things to note:
First, writing your own attribute is a fairly advanced use of ACIS which may not be needed to do what you are attempting. If you decide you need to do it, we urge you to consult Spatial support. This is simply because there are a lot of tricky details to get right writing your own ENTITYs from scratch.
Please note that the geometric information of a spline is encapsulated by the lower case spline class. The upper case SPLINE class owns a lower case spline and manages things like saving, restoring, and rolling the geometric data.
Second, the easiest way to store information using attributes is probably to use the generic attributes which are already written.The generic attributes ATTRIB_GEN_POINTER and ATTRIB_GEN_ENTITY can be used to store an alias to an entity (or an owned copy of an entity), respectively. If your ATTRIB_X is intended merely to store a reference to a SPLINE (which is owned by some other piece of the model), ATTRIB_GEN_POINTER is probably the easiest to use. On the other hand, if you made a lower case spline which does not occur in the model besides in your attrib, you probably should make an upper case SPLINE with it and store it on an ATTRIB_GEN_ENTITY.
Third, if you absolutely must save and restore a lower case surface, there is a function to do it, called restore_surface declared in surdef.hxx. If you only ever will be restoring splines, the function is restore_spline in spldef.hxx. I should again emphasize that this approach (writing your own attribute and storing data in it) is a very advanced use of ACIS. If you run into trouble doing this, you should directly contact Spatial support who would be happy to sell you some training or consulting service.
I hope this information is helpful to you. I have emphasized the difficulty of writing your own attribute because for many workflows the generic attributes can be used to get the same results more easily. Taking a low level approach may very well take a lot of your time, as well as our time trying to help you get it right. We want you to do things in the easiest and most correct way possible to save on your development time and ours.
best regards
Eric Zenk
Re: save and restore surface
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
07-10-2009 02:35 PM
Hi Eric,
Thanks for the reply. I tried out restore_surface () and it seems to be working fine so far.
I am not creating the attribute for saving the surface. The attribute is already a part of our architecture... containing a bunch of special data. The surface is just a new addition to the data. And the surface is a lower case spline which does not occur in the model besides the attrib. So far as I can see saving and restoring the lowercase surface is the best option for me.
There are some cases when the surface could be null. I am saving a logical just before the surface to indicate whether there is a surface following it or not. Is there a more elegant way to handle null cases.
Thanks,
uday.

