• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

InvalidObject understanding

Community Beginner ,
Aug 26, 2014 Aug 26, 2014

Copy link to clipboard

Copied

Hi,

I encounter an issue with custom objects, I try to find Element with the function Find(). When I search Xref, row or known elements I get a valid Object. If a search for a custom element like here "RuleTemplate" I get an InvalidObject. Here is my code :

var searchPropValRuleTemplate = AllocatePropVals(1) // allocate array of 1 PropVal

searchPropValRuleTemplate[0].propIdent.num = Constants.FS_FindElementTag // element search mode

searchPropValRuleTemplate[0].propVal.valType = Constants.FT_Strings; // property of type Strings (array of string)

searchPropValRuleTemplate[0].propVal.ssval.length = Constants.FV_NumFindElementItems; // required

searchPropValRuleTemplate[0].propVal.ssval[Constants.FV_FindElemTag] = "RuleTemplate"; // element to find

searchPropValRuleTemplate[0].propVal.ssval[Constants.FV_FindAttrName]= ""; // required even if empty

searchPropValRuleTemplate[0].propVal.ssval[Constants.FV_FindAttrValue] = ""; // required even if empty

var startLoc = new TextLoc(currentDoc.FirstPgfInDoc, 0);

var trFoundInDoc = currentDoc.Find(startLoc, searchPropValRuleTemplate);

var currentSGMLTag = currentDoc.ElementSelection.beg.child.Object;

var firstUidSGMLTag = currentSGMLTag.Unique;

In this sample currentSGMLTag is an InvalidObject, if I change the propval FindElemTag to "XRef" by example I get my XRef valid Object.

Can anyone help me please ? I'm missing something.

TOPICS
Scripting

Views

315

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
no replies

Have something to add?

Join the conversation