Author Topic: zoom viewport via objectdbx  (Read 2329 times)

0 Members and 1 Guest are viewing this topic.

mkweaver

  • Bull Frog
  • Posts: 352
zoom viewport via objectdbx
« on: January 17, 2019, 01:33:31 PM »
I am building a lisp routine to add a viewport to drawings via objectdbx.  I can add the viewport but I'm having trouble figuring out how to zoom said viewport.

I can find the view center from the entity list (cdr (assoc 12 elist)), but I can't modify it with entmod.  (assoc 40 elist) gets me the view width and (assoc 41 elist) gets me the view height, but I don't see these exposed in the vla-object.

Am I missing something, or is this really not possible from objectdbx?

Thanks,
Mike

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: zoom viewport via objectdbx
« Reply #1 on: January 17, 2019, 02:11:52 PM »
You can’t entmod viewports, no matter open in the editor or via odbx. Cue sad trombone. The properties exposed to activex that affect the view are nominal and incomplete (e.g. CustomScale, Direction, Target, TwistAngle etc). That said, you may be able to modify the viewport's xdata via activex (as much as a slugfest that is) which may be reflected in the viewport's view. Doubtful / untested. Wish I had the time to experiment, that would be a fun and useful pet project. An aside, you should be able to define named view entries (views collection) via activex, then mod via activex or entmake which may be helpful if/when a user opens the dwg. /thinking out loud ... [edit: fixed grammarz].
« Last Edit: January 17, 2019, 02:19:05 PM by MP »
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

mkweaver

  • Bull Frog
  • Posts: 352
Re: zoom viewport via objectdbx
« Reply #2 on: January 17, 2019, 03:43:44 PM »
You can’t entmod viewports, no matter open in the editor or via odbx. Cue sad trombone. The properties exposed to activex that affect the view are nominal and incomplete (e.g. CustomScale, Direction, Target, TwistAngle etc). That said, you may be able to modify the viewport's xdata via activex (as much as a slugfest that is) which may be reflected in the viewport's view. Doubtful / untested. Wish I had the time to experiment, that would be a fun and useful pet project. An aside, you should be able to define named view entries (views collection) via activex, then mod via activex or entmake which may be helpful if/when a user opens the dwg. /thinking out loud ... [edit: fixed grammarz].

I don't think I want to go the way of modifying the xdata.

I have 1200+ drawings I need to tweak, but the easy route is to handle it in my start up routine.

Thanks for the feedback.

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: zoom viewport via objectdbx
« Reply #3 on: January 17, 2019, 08:13:13 PM »
Ok + you’re most welcome.
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst