![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
Topic Title: Getting link information from an object Topic Summary: Created On: 8-Mar-2006 15:50 Status: Post and Reply |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() |
|||
Hi Mark
Whats the problem with out links? Just getting the attribute values? Out links works as per your code, for in links try using LinkRef to ensure modules are open first. See the attached code for an example of LinkRef and use of probeAttr_ to extract object and module attribute values, and alternative methods rem'd out. The attached file is has your code with a couple of changes to list the outlink targets module prefix, abs number, module name, and object text. You mentioned trying to get the module Prefix value, if you want the Object Identifer value just use the function identifier(o) as in the sample, its simplier than building it up from module prefix and absolute number values. This sample code is a simple bit of text hacked from layout dxl produced by the Wizard, note that it doesnt handle errors with links etc, as the code in your post, or baselines but does show LinkRef and probeAttr for module attribute values. > 1) Do you need to have the target modules open To get just the Absolute Number with out links, no, just use targetAbsNo(Link l) in the "for l in o" loop. Yes to get at all attributes. Yes for in links and use the function LinkRef first to get a handle on the module that the link goes to and use that to open the module. Create some layout DXL using the Wizard using the options "open" modules and "all" modules and see the differences, note where the target\source modules are opened (read(module). Trying running the layout DXL wizard for in/out links and compare, choosing some module and object attributes. Setup a view with incoming links, and use "Manage open modules" to in Project Explorer to see that the target module is open. Edit the layout dxl to remove\rem out the lines to open the module if object is null (about line 23/24). Refresh view, with target module still closed nothing is displayed. Manually open the target module and the column is populated. > 2) What does probeAttr_() do? probeAttr_ and probeRichAttr_ are undocumented functions, they return a string, extracting module or object attribute information, see attached code for examples, do a search in this forum for further info and possible errors, but in summary; string = probeAttr_(Object or Module, string Attribute) string = probeRichAttr_(Object or Module, string Attribute,true\false) Its reported that probing is better than using something like s = othero."Absolute Number" or otherMod."Prefix". Other references to the function refer to getting values for object attributes but it works for module attributes as well (see lib\dxl\utils\attrutil.inc). For module name and description can also use s = name(otherMod) or s = description(otherMod) as in rem'd out lines in sample code. > Is there a trick in this forum to get new lines, etc? You might find it easier to put code into the code box offered in the edit/reply window, see the reply button at the bottom of posts rather than quick reply, or "Attach Code" option in new post. > otherMod... was not able to extract the prefix from another module (only from the current module) Sounds like otherMod is not set to the "other" Module. Add a bit od dxl to help debug, try checking if otherMod."Name" equals the "source" module or not, if it is, ensure you get a handle on the other module.
------------------------- Paul Ransley<BR><BR>Beaver Computer Consultants Limited Edited: 9-Mar-2006 at 04:44 by Paul Ransley |
|||
![]() |
|||
![]() |
|||
Yes. For scripts that work on the module used to invoke them, you should routinely do something like this:
Module mCurr = current if (null mCurr){infoBox("Run from open module."); halt} ... Sometimes you need to "current = mCurr" within the code, for functions that presume the current module such as find(attribute name). - Louie |
|||
![]() |
Telelogic DOORS
» DXL Exchange
»
Getting link information from an object
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.