Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Highlight Object in Model space,which is visible in viewport

I am trying to Highlight objects which is exists in model space,

but my current space is Paperspace, i use the following code, which work perfectly in AutoCAD,
In BricsCAD the same code got execute, but did't get any results.

below is the snip of code:

Using lock As APPSER.DocumentLock = APPSER.Application.DocumentManager.MdiActiveDocument.LockDocument
Using tr As Transaction = curDb.TransactionManager.StartTransaction()

highlight_obj = New Microsoft.VisualBasic.Collection

For rid = 0 To ListBox1.SelectedItems.Count - 1
Dim AllObj_ids As String() = Room_Step_Details(Int(ListBox1.SelectedItems(rid).ToString.Replace("Room ", ""))).Split(New Char() {","c})

For n = 0 To AllObj_ids.Length - 1
highlight_obj.Add(AllObj_ids(n))

Dim obj As ObjectId = curDb.GetObjectId(False, New Handle(Convert.ToInt64(AllObj_ids(n), 16)), 0)
Dim ent As Entity = tr.GetObject(obj, OpenMode.ForWrite)
ed.SwitchToModelSpace()
ent.Highlight()
ed.UpdateScreen()
ed.SwitchToPaperSpace()

Next
Next
tr.Commit()
End Using
End Using

please advice what needs to be change to achive the result.

Thanks in Advance

Comments

  • I use the highlighting method in the same way. There is no need to switch spaces and call UpdateScreen - these are unnecessary steps. The backlight works great in BricsCAD.

Sign In or Register to comment.
Origami
Origami is the Japanese word for paper folding. ORI means to fold and KAMI means paper and involves the creation of paper forms usually entirely by folding.

Powered by VanillaForums, Designed by Steam