Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Do you have a DOORS DXL script that can move objects to other locations within the same module if the location is spectified in the object attribute?

Greetings,

Does anyone have a DOORS dxl script that can automatically loop through a large group of newly imported objects (located at the bottom of a DOORS module) and move each object to another location in the module that is specified in an attribute of that object?

Greg

0 votes



One answer

Permanent link

Hi Greg,

You could use something like this. New objects are deemed to be those with a non-null value in the attribute containing the target object. So to avoid unwanted moving, objects which exist before the import will need to have it set to null before running.

// If an object has a value in the attribute specified in "targetAttrName" it will
// be moved to the Object whos Absolute Number corresponds to that value

// Exact target location can be changed by altering "move(o, targetObj)"
// Current move behaviour makes moved objects the last child of the specified target

Module m = current
Object o, targetObj

int targetObjAbsNo
string targetAttrName = "trg"

for o in entire m do {

    targetObjAbsNo = null
    targetObjAbsNo = o.targetAttrName

    if (!null targetObjAbsNo) {

        targetObj = object (targetObjAbsNo, m)
        move(o, targetObj)

        o.targetAttrName = null
    }
}
Regards,
Stuart.

0 votes

Comments

 Thanks Stuart, for the response. I will check this out.


-Greg

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 198

Question asked: Jan 09 '24, 8:56 p.m.

Question was seen: 831 times

Last updated: Jan 12 '24, 10:23 p.m.

Confirmation Cancel Confirm