Author Topic: Create named view with twist  (Read 4097 times)

0 Members and 1 Guest are viewing this topic.

rkmcswain

  • Swamp Rat
  • Posts: 978
Create named view with twist
« on: February 21, 2006, 08:05:39 AM »
I'm probably missing something simple here, but how do you define a
named view that is not parallel to the WCS?

See attached image. I need to define a view for each rectangle. In lisp,
group 50 defines the twist angle, but from everything I have seen, this
property doesn't exist for the View object in VBA.

TIA



(Duplicate of post made in [news://discussion.autodesk.com/autodesk.autocad.customization.vba] on 20 Feb)

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Create named view with twist
« Reply #1 on: February 21, 2006, 09:19:11 AM »
As far as I know you have to use entmake / entmod unless you resort to arx.
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Create named view with twist
« Reply #2 on: February 21, 2006, 09:41:35 AM »
PS: Welcome to the swamp Mr. McSwain.

:)
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

Draftek

  • Guest
Re: Create named view with twist
« Reply #3 on: February 21, 2006, 09:57:20 AM »
hmm. I just happen to be finishing up a context menu for rotating viewports in c#.

It sure does look like autodesk is slowly dropping support for the activex interface.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Create named view with twist
« Reply #4 on: February 21, 2006, 10:05:41 AM »
Welcome to theSwamp RK'

That piccy looks familiar, but my brain is shot and it's past pumpkin time.

I have a recollection that Glenn < GlennR> has done some work on this issue .. he may drop in ..
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

MickD

  • King Gator
  • Posts: 3619
  • (x-in)->[process]->(y-out) ... simples!
Re: Create named view with twist
« Reply #5 on: February 21, 2006, 04:44:06 PM »
while this isn't a coded solution you can use it to create your saved views.
Set the ucs (objectUCS) to the rectangular object you want the view on, go to the views menu, select 3dviews->planview->current ucs. This will set up your view at the twisted angle. Or at the command prompt -> 'plan' 'enter'
To save the view open the  named views dialog and selct 'New', here you can also define a size for the view with a selected window.

As both the view and viewport objects derive from the AcDbAbstractViewTableRecord object, both of these objects have this functionality available in ARX but I couldn't see it in the vba object model. There may be a way of working with a viewport object and checking tilemodes etc to define whether the view in question is a view or viewport object but that may be a longshot(?)

hth.
"Short cuts make long delays,' argued Pippin.”
J.R.R. Tolkien

rkmcswain

  • Swamp Rat
  • Posts: 978
Re: Create named view with twist
« Reply #6 on: February 21, 2006, 04:59:14 PM »
Although I have abandoned the whole idea...  :cry:

...here is how I almost got it to work. It may be helpful to someone trying to create one view.

  • Define a UCS rotated the same as the desired view
  • Set that UCS current
  • Rotate the display so that this plan view is current
  • Write a lisp file to disc defining an (entmake) call to create the view
  • Use SendCommand (or Vl.Application) to force AutoCAD to load this lisp

(steps 1-3 is necessary so that the center point you pass to the entmake call is a DCS coordinate)

Everything worked except that this was running in a loop, and each lisp code simply stayed in memory until the VBA code finished, then it executed. Well, since I was writing the same file over and over, only the last lisp ran.

I could have probably made it work by writing unique files, but by this point I felt I was walking in glass as it was. Too convoluted and kludgy to be a real solution. I suppose if you needed to create a single view every now and then, this method might work. But this app may have to create hundreds of views at one time.

I understand it may be possible to create named views using .NET? Any thoughts?

LE

  • Guest
Re: Create named view with twist
« Reply #7 on: February 21, 2006, 05:06:58 PM »
Since is something I have not used in normal autocad, I am not familiar with the steps... but it is possible that I can write a command using objectARX....

Let me read the whole thread....

MickD

  • King Gator
  • Posts: 3619
  • (x-in)->[process]->(y-out) ... simples!
Re: Create named view with twist
« Reply #8 on: February 21, 2006, 05:08:47 PM »

I understand it may be possible to create named views using .NET? Any thoughts?

Yes you could as the ViewTableRecord inherits from the AbstractViewTableRecord which has a ViewTwist property with get/set methods. The hard bit will be working out your twist angle from the objects.
"Short cuts make long delays,' argued Pippin.”
J.R.R. Tolkien

Glenn R

  • Guest
Re: Create named view with twist
« Reply #9 on: February 21, 2006, 09:25:11 PM »
I created just such a beastie as you describe 6 months ago and it will do hundreds of views in seconds.

These are then cloned into other drawings that are created in memory (again literally several hundred drawings created per minute) with the relevant view set.

I am busy at the moment, but will chime in with more tonight. BTW, there is no elegant way to do this in ActiveX VBA...you have to use lisp, .NET or ARX.

Cheers,
Glenn.