我使用dxl代码来检索所有的外链接,并且工作正常。
但它似乎只检索了一些链接而忽略了其他链接,我不知道为什么!
这是代码段
Object o
string label
Module m = read(planSpecReportPath_inDoors)
Link outLink
for o in m do
{
for outLink in o -> "*" do
{
parentModName = target(outLink)
iTarget= targetAbsNo(outLink)
任何人都可以告诉我什么是获得所有外链的一般解决方案?我错过了什么?
感谢
答案 0 :(得分:2)
first of all, for clarity's sake I though I should mention that your comment says your script gets all outlinks to current modules, but the script you posted will only retrieve outlinks from the module at path planSpecReportPath_inDoors. You can change the script to work for the current module by modifying your code to the following:
Module m = current Module
Secondly, if I understand your question and comment correctly, you want to cycle through each outlink in a module, including the outlinks from previous baselines right? this can be done with a fairly simple script:
Module baselineM = null
Module m = read(planSpecReportPath_inDoors)
Object o = null
Link outLink = null
Baseline b = null
for b in all m do
{
// Load the current baseline and display it
baselineM = load(m, b, true)
for o in entire(m) do
{
for outLink in o -> "*" do
{
parentModName = target(outLink)
iTarget= targetAbsNo(outLink)
// Whatever else you want to do with each link
}
}
}
Basically, you would need to cycle through each baseline individually, then cycle through all of the objects in that baseline, then cycle through each link. I hope that answers your question!