![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
Topic Title: Converting Object Heading to Object Text? Topic Summary: Created On: 5-Nov-2003 14:29 Status: Post and Reply |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() |
|
Is there a way to convert Object Headings to Object Text via DXL? If so, how would I code it?
Thanks, Mary |
|
![]() |
|
![]() |
|
See attached
Edited: 5-Nov-2003 at 15:32 by Louie Landale |
|
![]() |
|
![]() |
|
This script will demote a single object. To do it for an entire module you would just add a Module variable and add a "for do" statement
Object o = current string txt,hdg txt = probeAttr_(o,"Object Text") hdg = probeAttr_(o,"Object Heading") if ((txt == null) && (hdg != null)) { o."Object Text" = hdg o."Object Heading" = "" } ------------------------- David A. Rose TSgt USAF NCOIC System Administration |
|
![]() |
|
![]() |
|
Using the probeAttr_ function looks good - but this is an undocumented function call and may not be supported in the same way between DOORS versions.
If the function was explained in the DOORS ref manual - I would use it -- however since it is not, I would use Louie's solution. (If anyone has a complete list of these functions - it would be a nice-to-have reference) cliff bly Lockheed Martin Canada ------------------------- Cliff Bly |
|
![]() |
|
![]() |
|
I haven't been able to get either set of scripts to work with what I have so far. I will explain what I am doing in more detail. I am generating a template. When that template is being created, I have a script that inserts an object, and then sets some of the attributes to a specific value.
The inserted object still shows up as a heading instead of an object without any text. What else do I need to fix my script or did I misplace some code? Here is what I tried with Louie's code: Object o Module m = current void MoveHeadingToText() { // Louie's code here. } void sectAttr() { o = first( m ) for o in m do { o = next( o ) if( null o ) { } else if( number( o ) "" == "4.1.1." ) { o = create below( o ) MovingHeadingToText( o ) o."*Object Type" = "Test Description" } } } sectAttr |
|
![]() |
|
![]() |
|
I made a typo when I typed my code. Here it is, but I fleshed out the code this time.
Thanks, Mary >>>>>>>>>>>> Object o Module m = current void MoveHeadingToText(Object obj) { if( null obj ) return string Head = richText( obj."Object Heading" ) string Text = richTextWithOle( obj."Object Text" ) if( null Head ) {} else { obj."Object Text" = richText( Head ) obj."Object Heading" = "" } } void sectAttr() { o = first( m ) for o in m do { o = next( o ) // next object if( null o ) { } else if( number( o ) "" == "4.1.1." ) { o = create below( o ) // create an object below MovingHeadingToText( o ) o."*Object Type" = "Test Description" // Set the *Object Type attribute } } } sectAttr |
|
![]() |
|
![]() |
|
I'd be very interested in how much trouble you get into when you modify the loop variable (o) while inside the loop. I'd also be interested if using the same variable in the create statement causes a problem. I suggest you use variables "oNext" and "oNew"; even if your code DOES work.
Also, your code seems to be moving Heading to Text for a just-created object. Since the heading is null, nothing will happen. Dare I suggest the following: did you know that an "empty" object (no Heading, Text, Picture (nor OLE in v5)) appears as if it was a Heading in the Hierarchy? e.g. the object created below object 3.1 will be empty, but be number 3.1.1 and appears as if it was a Heading. Only objects containing Text, Picture (or OLE in v5) appear with "0.-" numbers and do NOT show their paragraph number in the Main column. That's an unfortunate lagacy reality of DOORS. Perhaps what you REALLY want to do is add a space " " to such Object's Text. That will make them look like normal objects in the Main column. - Louie |
|
![]() |
Telelogic DOORS
» DXL Exchange
»
Converting Object Heading to Object Text?
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.