Friday, August 19, 2005

VBScript formula that uses the ADT API

After reading this blog post by Richard Binning, Beside the Cursor about ADT: VBScripting Resources List I recall a little VBScript for ADT that I've used in a Formula Property Definition in a Property Set Definition. I wanted to schedule the width of the wall that the door is anchored to. These few rows solves this by using the Handle of the door and using the ADT API to get the Width.

on error resume next
Set app=GetObject(,"AutoCAD.Application")
Set aDoor = app.activedocument.handletoobject("[Handle]")
Set anAnchor = aDoor.GetAnchor
Set aWall = anAnchor.Reference
RESULT= aWall.Width

No comments:

Post a Comment

Subscribe to the comments feed

Some of the latest blog posts

Subscribe to RSS headline updates from:
Powered by FeedBurner

Contact Us | About JTB World | Subscribe to this blog
JTB World's website | Website General Terms of Use | Privacy Policy
^ Top of page

© 2004- JTB World. All rights reserved.