Author Topic: hide some entities in viewport A, but show in viewportB, how to do this?  (Read 553 times)

0 Members and 1 Guest are viewing this topic.

nolanjian

  • Mosquito
  • Posts: 7
hi,
I want to hide some entities in viewport A, but show in viewport B, can this be implement?
I have try some way, but not work?
anyone has ever do this before?

MickD

  • Gator
  • Posts: 2970
  • I don't need a job, I need Money!!
Re: hide some entities in viewport A, but show in viewportB, how to do this?
« Reply #1 on: September 14, 2017, 01:10:56 am »
Hi nolanjian, welcome to the swamp!

Are you wanting to do this with C++ or C#?

I haven't done much work with viewports and entities but I'd imagine it would be similar to model space in regards to visibility.
First, you must know what entities you want to hide, if they are by layer then you can freeze that layer for that viewport. If you know their object id's or handles you will need to do a bit more work but once you have them you can set the entities Visible property in relation to the chosen viewport.

I just did a quick search and this may be a good start http://through-the-interface.typepad.com/through_the_interface/2015/10/displaying-different-entities-in-autocad-viewports-using-net.html
I only had a quick browse but it may be a start.

If you are using C++ it should be pretty similar but you'll have to manage pointers :)
"A language that doesn’t have everything is actually easier to program in than some that do."

        — Dennis M. Ritchie

nolanjian

  • Mosquito
  • Posts: 7
Re: hide some entities in viewport A, but show in viewportB, how to do this?
« Reply #2 on: September 14, 2017, 04:46:13 am »
hi, MickD.
thx, and my project work on C++, I have search a lot, somewhat disappointed.. :no:

MickD

  • Gator
  • Posts: 2970
  • I don't need a job, I need Money!!
Re: hide some entities in viewport A, but show in viewportB, how to do this?
« Reply #3 on: September 14, 2017, 05:24:26 pm »
Can you share any code you have so far so we have something to start with? Even if it's just a small project to isolate this feature.

Also:
- what version of AutoCAD are you using?
- how will you identify the entities to be hidden? Will they be on certain layers or have xdata for identification?
- how do you identify the viewport that will hide the hidden entities? layers, xdata?
- do you have a sample drawing we can use for testing?

The more you can give us the easier it will be for someone to help :)
"A language that doesn’t have everything is actually easier to program in than some that do."

        — Dennis M. Ritchie

nullptr

  • BricsCAD
  • Needs a day job
  • Posts: 6736
  • AKA Daniel
Re: hide some entities in viewport A, but show in viewportB, how to do this?
« Reply #4 on: September 14, 2017, 08:27:51 pm »
Might try DrawableOverrule.

Edit: I see Mick's link does just that..

nolanjian

  • Mosquito
  • Posts: 7
Re: hide some entities in viewport A, but show in viewportB, how to do this?
« Reply #5 on: September 14, 2017, 09:49:28 pm »
I'm using Autocad2014.
The user story is quite simple,  read XML data file and build entities, so this step can identify which entity belongs to which group(viewport).
I alse have a post in Autocad community. https://forums.autodesk.com/t5/objectarx/hiding-entities-in-viewports/m-p/7382329#M36219

I will have a try today, hope it works.

vincent.r

  • Mosquito
  • Posts: 14
Re: hide some entities in viewport A, but show in viewportB, how to do this?
« Reply #6 on: September 15, 2017, 09:44:49 am »
Have you tried layer on/off features in respective layout windows ?

nolanjian

  • Mosquito
  • Posts: 7
Re: hide some entities in viewport A, but show in viewportB, how to do this?
« Reply #7 on: September 22, 2017, 09:07:26 pm »
I have try layers, this way work, but maybe not the best.