AutoCAD Architecture Customization
Welcome to Autodesk’s AutoCAD Architecture Customization Forums. Share your knowledge, ask questions, and explore popular AutoCAD Architecture Customization topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Vlisp -ActiveX.

2 REPLIES 2
Reply
Message 1 of 3
Anonymous
238 Views, 2 Replies

Vlisp -ActiveX.

I have been using this routine to pull the AEC object properties (or
acad)
and since Peter recently talked about this subject, I wanted to askhow
to gain access to the aecArchDatabasePreferences database, so I can get
the properties in there ;ole DatabaseScale, etc.
using the get-property or put property routines (not sure if I use
those.)

thanks

;;Get a selected object property and return it.
;;pass the (ENTSEL) and prop required.
;;usage (setq wallwid (getprop ss1 Width))
(defun getProp (ss1 prop / ent vlaobj proprty)
;;Nauman Mysorewala
;(setq ent (car (entsel)))
(setq vlaobj (vlax-ename->vla-object ss1))
(IF
(vlax-property-available-p VLAOBJ PROP)
(setq proprty (vlax-get-property vlaobj prop))
(PRINC (strcat prop " is not a Vaild Property for this type of
object"))
)
(vlax-release-object vlaobj)
proprty
)

--

-------------------
Nauman M
CAD Bazaar
Need to easily Navigate to your Custom Content Folders?
Need Autolayering for Dimensions without going through Design Center?
Download the updated ADT Tools for ADT 2 & 3 at
http://www.cadbazaar.com
2 REPLIES 2
Message 2 of 3
Anonymous
in reply to: Anonymous

First Nauman you posted a different code than what you were asking for. I
will answer both.

as per you lisp code here is the VBA code
Public Sub GetObj()
Dim objTemp As AcadEntity
Dim objUtil As AcadUtility
Dim varPnt As Variant
Dim Wall As AecWall
ThisDrawing.Utility.GetEntity objTemp, varPnt, "Select Object"
If TypeOf objTemp Is AecWall Then
Set Wall = objTemp
Wall.CleanupRadius = 60 'changes cleanupradius to 60
'set a break at this point and then do a watch on WALL
'You will see all available settings
'before you go setting stylenames check
'to see if they exist in the dwg
End If


End Sub


as per the database code

Public Sub PrefAccess()
Dim doc As New AecArchBaseDocument
Dim Pref As AecArchBaseDatabasePreferences
doc.Init ThisDrawing
Set doc = AecArchBaseApplication.ActiveDocument
Set Pref = doc.Preferences
Pref.DatabaseScale = 192
Pref.OLELaunch = True
End Sub


--
-------------------------------------------------------------------------
Rob Starz
Plogv 3.0 & 2000 (plot logging) for r14 & 2000
***Enhancement Tools for Arch. Desktop *****
!!!!!Beta Testers Needed For DormerX!!!!!!!
http://www.stardsign.com/DormerXForm.htm
http://www.stardsign.com/main.htm
Message 3 of 3
Anonymous
in reply to: Anonymous

I was asking on how to gain access to the aecdatabase via vlisp-activeX:
sorry i was not clear there. the routine was posted as an example only ,
that I can access properties of selected objects, but how to pull from
database , like the scale, etc. was not looking for the translation in
VBA..
more so the translation from VBA to VLISP..
of
Public Sub PrefAccess()
Dim doc As New AecArchBaseDocument
Dim Pref As AecArchBaseDatabasePreferences
doc.Init ThisDrawing
Set doc = AecArchBaseApplication.ActiveDocument
Set Pref = doc.Preferences
Pref.DatabaseScale = 192
Pref.OLELaunch = True
End Sub

thanks


Rob Starz wrote:
>
> First Nauman you posted a different code than what you were asking for. I
> will answer both.
>
> as per you lisp code here is the VBA code
> Public Sub GetObj()
> Dim objTemp As AcadEntity
> Dim objUtil As AcadUtility
> Dim varPnt As Variant
> Dim Wall As AecWall
> ThisDrawing.Utility.GetEntity objTemp, varPnt, "Select Object"
> If TypeOf objTemp Is AecWall Then
> Set Wall = objTemp
> Wall.CleanupRadius = 60 'changes cleanupradius to 60
> 'set a break at this point and then do a watch on WALL
> 'You will see all available settings
> 'before you go setting stylenames check
> 'to see if they exist in the dwg
> End If
>
> End Sub
>
> as per the database code
>
> Public Sub PrefAccess()
> Dim doc As New AecArchBaseDocument
> Dim Pref As AecArchBaseDatabasePreferences
> doc.Init ThisDrawing
> Set doc = AecArchBaseApplication.ActiveDocument
> Set Pref = doc.Preferences
> Pref.DatabaseScale = 192
> Pref.OLELaunch = True
> End Sub
>
> --
> -------------------------------------------------------------------------
> Rob Starz
> Plogv 3.0 & 2000 (plot logging) for r14 & 2000
> ***Enhancement Tools for Arch. Desktop *****
> !!!!!Beta Testers Needed For DormerX!!!!!!!
> http://www.stardsign.com/DormerXForm.htm
> http://www.stardsign.com/main.htm

--

-------------------
Nauman M
CAD Bazaar
Need to easily Navigate to your Custom Content Folders?
Need Autolayering for Dimensions without going through Design Center?
Download the updated ADT Tools for ADT 2 & 3 at
http://www.cadbazaar.com

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost