Property of References

1) How can I get bounding box value of a attached reference(DGN) file?
2) How to set values for the properties like attachment.ScaleMasterUnits,IsTruescale,etc.,? I tried as per the sample code given below. But compile error occured(Error : "Can't assign to read-only property").

Public Sub attachRef()
Dim atts As Attachments
Dim att As attachment

Set atts = ActiveModelReference.Attachments
Set att = atts.AddCoincident("D:\temp\test.dgn", "model", "logName", "descr", True)
att.ScaleFactor = 1
'att.ScaleMasterUnits = 1
'att.IsTrueScale = True
End Sub

Parents
  • Hi Dharmarajan,

    one question per post, please.

    Unknown said:
    How can I get bounding box value of a attached reference(DGN) file?

    By bounding box do you mean boundaries displayed when the reference is selected in Reference dialog? I think it's not stored anywhere. You probably can start with Range property, which I think is identical with boundaries if the attachment is not rotated.

    Unknown said:
    How to set values for the properties like attachment.ScaleMasterUnits,IsTruescale,etc.,?

    It's too general question, because some properties are read-only, some are read / write, some can be set anytime, some only when a file is attached. Any property started with Is... is read only. So please individually what property you want to use and what do you want to achieve.

    Unknown said:
    I tried as per the sample code given below.

    I tried it and it works fine, no error.

    With regards,

      Jan

  • Thanks Jan.

    [Actually compile error occurs at "att.ScaleMasterUnits = 1". Sorry I commented it to avoid compile error during testing and I posted the same.]

    while attaching, two reference DGN files are placed at different location by default(by using attachment method:Coincident). But what I want to achieve is, to attach a reference file based on the bounding box of another reference file which is already attached. As you suggested the Range property was useful to do that.

Reply
  • Thanks Jan.

    [Actually compile error occurs at "att.ScaleMasterUnits = 1". Sorry I commented it to avoid compile error during testing and I posted the same.]

    while attaching, two reference DGN files are placed at different location by default(by using attachment method:Coincident). But what I want to achieve is, to attach a reference file based on the bounding box of another reference file which is already attached. As you suggested the Range property was useful to do that.

Children
No Data