Can any body tell me the solution for this error?

Anonymous
Anonymous

hi,

i am getting  this error as Active model reference is not set

can any body help me out

thanks

Praveen E

Parents Reply
  • it is elementenumerator.

    oElEnum = Application.ActiveModelReference.GetSelectedElements();

    now it is woring fine when i restarted the system.........

    what if it comes again the same error how we need to handle it or we need to set in bentley Map XM any model reference?

    please help...

     

    - praveen E

Children
  • praveeneswarrao:

    it is elementenumerator.

    oElEnum = Application.ActiveModelReference.GetSelectedElements();

    It sounds like the variable you used was a 'preserved' name or object name. For example declaring an Element as element may create a conflict.

    For example 'Dim element As Element' or 'Dim elementenumerator As ElementEnumerator' can create unwanted or unexpected errors or results..

    Perhaps if your element has been declared elsewhere or is uncleared may cause the same unexpected error or result..

    Hope This Helps.

    /Rob

    CADMinistrator ®

  • Be Precise; Be Explicit

    Praveen:
    "What is the declaration of element?"
    it is elementenumerator. oElEnum = Application.ActiveModelReference.GetSelectedElements();

    Well, I had guessed that it is an element enumerator. However, this is a programming forum, and you asked a question about program code.

    When I ask a question such as "What is the declaration of element?", I expect an answer in the form that you write it in code. For example: ElementEnumerator oEnumerator; Why?

    • The formal declaration tells us exactly what you want to achieve
    • The formal declaration reveals spelling mistakes, including UPPER/lower case errors
    • The formal declaration makes it easier for someone to test your code

    As an example, your previous posting included this line:

    application.Activemodelreferenc,getselectedelements();

    That line would not be accepted by the C# editor, nor would it have compiled. It's best to copy-and-paste from your code; retyping code introduces human errors that may not be present in the original.

    Regards, Jon Summers
    LA Solutions

     
    Regards, Jon Summers
    LA Solutions

  • sorry for that and thanks for the suggestion.

    jon and thex...