Welcome to Telelogic Product Support
  Home Downloads Knowledgebase Case Tracking Licensing Help Telelogic Passport
Telelogic DOORS (steve huntington)
Decrease font size
Increase font size
Topic Title: Copy contents of attribute from object 1 to same attribute in object 2
Topic Summary:
Created On: 1-Feb-2008 19:48
Status: Post and Reply
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
Quick Reply Quick Reply
Subscribe to this topic Subscribe to this topic
E-mail this topic to someone. E-mail this topic
Bookmark this topic Bookmark this topic
View similar topics View similar topics
View topic in raw text format. Print this topic.
 1-Feb-2008 19:48
User is offline View Users Profile Print this message


Scott Boisvert

Posts: 348
Joined: 14-Apr-2006

OK...This sounds simple enough on the top and probably is, I'm just over looking something.

I'm specifically referring to the "Object Text" attribute. I have objects may contain OLE's or pictures along with text.

The copy objects function will create a new object in a new module fine and dandy and have played around in that script (doorsHome\lib\dxl\standard\fns\copyObjects.inc), but I'm can't seem to figure out how the objects are copied with the OLE/Picture and the text.

I've tried the oleCopy and olePaste functions, but the ole isn't placed in the correct spot in reference to the text.

Any ideas?

Thanks,

-------------------------
Scott Boisvert
Engineering Tools Administrator
L-3 Communications - Avionics Systems
scott.boisvert@l-3com.com
Report this to a Moderator Report this to a Moderator
 1-Feb-2008 19:58
User is offline View Users Profile Print this message


Scott Boisvert

Posts: 348
Joined: 14-Apr-2006

Damnit....

I keep posting a question on here and then find the answer 5 minutes later.

set (newObject."Object Text", oldObject."Object Text")

-------------------------
Scott Boisvert
Engineering Tools Administrator
L-3 Communications - Avionics Systems
scott.boisvert@l-3com.com
Report this to a Moderator Report this to a Moderator
 1-Feb-2008 20:56
User is offline View Users Profile Print this message


David Pechacek

Posts: 674
Joined: 5-Dec-2006

Scott also check out my tool here.

Copy Values

-------------------------
David Pechacek
AAI Services Textron
dpechacek@sc-aaicorp.com
David.Pechacek@gmail.com
Report this to a Moderator Report this to a Moderator
 1-Feb-2008 21:09
User is offline View Users Profile Print this message


Scott Boisvert

Posts: 348
Joined: 14-Apr-2006

Thanks David.

Wish links were like attributes....lol.

One thing I did notice about the set function mentioned above, is that it seems like you do not have to check if the attribute has been modified.

For example, I have object1 and object2, the "Object Text" attribute is the same in both. I issue the set (object1."Object Text", object2."Object Text") command. object1 is not modified, so it would seem that function checks if the attributes are the same before copying the info over. I checked the history when doing this and there is no history record either which supports this even more.

This is actually nice because now I don't have to write the code to check for differences first.

-------------------------
Scott Boisvert
Engineering Tools Administrator
L-3 Communications - Avionics Systems
scott.boisvert@l-3com.com
Report this to a Moderator Report this to a Moderator
 1-Feb-2008 21:10
User is offline View Users Profile Print this message


David Pechacek

Posts: 674
Joined: 5-Dec-2006

I can't seem to find that function in the DXL Reference manual. Is it undocumented?

-------------------------
David Pechacek
AAI Services Textron
dpechacek@sc-aaicorp.com
David.Pechacek@gmail.com
Report this to a Moderator Report this to a Moderator
 1-Feb-2008 21:15
User is offline View Users Profile Print this message


Scott Boisvert

Posts: 348
Joined: 14-Apr-2006

That would be my guess, I found it in....

doorsHome\lib\dxl\standard\fns\copyAttributes.dxl (line 63).

-------------------------
Scott Boisvert
Engineering Tools Administrator
L-3 Communications - Avionics Systems
scott.boisvert@l-3com.com
Report this to a Moderator Report this to a Moderator
 1-Feb-2008 21:24
User is offline View Users Profile Print this message


David Pechacek

Posts: 674
Joined: 5-Dec-2006

Interesting...I might use this in my tool. Thanks Scott.

-------------------------
David Pechacek
AAI Services Textron
dpechacek@sc-aaicorp.com
David.Pechacek@gmail.com
Report this to a Moderator Report this to a Moderator
 4-Feb-2008 17:08
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

Never seen this 'set', but I now see it in the doors.exe file. Doesn't seem to be in the DXL manual.

An object is not changed nor is History generated when you assign an attribute value in such a way that it doesn't change. o."A" = "B" generates no History when the value is already "B". This is not a feature unique to the 'set' command.

In doors.exe, I see that this 'set' command returns a string. Normally that would be some sort of Error string. I see in the example that 'set' errors are trapped with noError() and lastError(). Testing shows that trapping works, but that the string returned from set is null when its OK and garbage when attr2 doesn't exist. I see that if you don't trap the errors, DXL aborts. Makes me wonder what the returned string could be.

We really should somehow test this 'set' command to see if it generates wasted string-table space. Surely the normal: o1."Object Text" = richText(richTextWithOle(o2."Object Text")) wastes space, even when o1 already has that exact value. If set eliminates that, then it will prove to be a great function to use.

EDIT: I now notice with considerable alarm the checks in that code to report when an attr-value has been 'truncated' by 'set'; look for 'matrTruncated' in copyAttributes.dxl. Egads, if it truncates then its practically useless.

- Louie

Edited: 4-Feb-2008 at 17:12 by Louie Landale
Report this to a Moderator Report this to a Moderator
 4-Feb-2008 17:20
User is offline View Users Profile Print this message


Scott Boisvert

Posts: 348
Joined: 14-Apr-2006

I wonder if the truncation is a check if the attribute is of a string type. I've seen truncation happen in this situation before when copying text from a text type attribute to a string type attribute.

For some reason the string type seems to be limited to how much data it can hold, while the text can hold much more (I've never hit the limit). Hence for this reason I've stayed away from string type attributes, just in case I need to dump more information into the attribute.

This is where your truncation might come into play. I'll have to look a little bit closer at the code that checks for truncation....

-------------------------
Scott Boisvert
Engineering Tools Administrator
L-3 Communications - Avionics Systems
scott.boisvert@l-3com.com
Report this to a Moderator Report this to a Moderator
 4-Feb-2008 17:33
User is offline View Users Profile Print this message


Scott Boisvert

Posts: 348
Joined: 14-Apr-2006

Aye, just tested that theory with the copying more data than a string type attribute can accept.

Here's what I did.....

- Created a "Test" attribute of type "string"
- Dumped a bunch of text into the "Object Text" of the same object.
- Ran the attached script.

Script printed the following error:

-R-W- DXL: <Line:4> value assigned to string attribute 'Test' truncated

If you comment out the print statement, you don't get the error.

-------------------------
Scott Boisvert
Engineering Tools Administrator
L-3 Communications - Avionics Systems
scott.boisvert@l-3com.com
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic DOORS forum.
There are currently 1 users logged in.
The most users ever online was 15 on 15-Jan-2009 at 16:36.
There are currently 0 guests browsing this forum, which makes a total of 1 users using this forum.
You have posted 0 messages to this forum. 0 overall.

FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.