Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Reply
Message 1 of 3
Anonymous
129 Views, 2 Replies

Pagesetup

Is there a way to do a new pagesetup from lisp? Any help will be appreciated.
2 REPLIES 2
Message 2 of 3
Anonymous
in reply to: Anonymous

Are you familiar with ActiveX methods? Start by looking at the following: vla-add vla-get-plotconfigurations vla-get-activedocument vlax-get-acad-object You can find them in the AutoLISP reference and the ActiveX and VBA reference. -- -Jason Member of the Autodesk Discussion Forum Moderator Program "hanksor" wrote in message news:3fe099b3$1_6@statler... > Is there a way to do a new pagesetup from lisp? Any help will be > appreciated. > >
Message 3 of 3
cab2k
in reply to: Anonymous

From another thread:


;;; AddPstyletoDict.lsp
;;;
;;; Joe Funk, Sept.29/01; last revised Nov.01-02.
;;;
;;; Force an entry into the plotStyleName dictionary using ENTMAKEX
;;; and ENTMOD. Eg. create an entry for a non-existent plotstyle, or for
;;; a plotstyle not yet applied to an object in the dwg.
;;; Suggested in the following posting by Art Cooney:
;;;<
;;;From: "Art Cooney"
;;;Subject: PS
;;;Date: Monday, April 17, 2000 11:43 PM
;;;
;;; AcDbPlaceHolder is a "dataless" object type that's simply meant to
;;;be used in the plotStyleName dictionary in order to have an object
;;;(and therefore an objectId) to associate with a plotStyleName.
;;;
;;; You should be to use (entmakex) to create one and then use (entmod)
;;;on the dictionary you want to add it to in order to let the dictionary
;;;know that it's the new owner.
;;;>
;;;
;;;================================================ ======================
;;;
;;; Function: addpstyletodict
;;;
;;; Add an entry for a plotstyle to the ACAD_PLOTSTYLENAME dictionary.
;;;
;;;------------------------------------------------------ ----------------
;;;

(defun addpstyletodict ( PSTYLENAME /
PSTYDICT-INFO PSTYDICT-ENAME PS-ENAME XLIST
NEW-PLACEHOLDER TMP-DATLST 340PAIR 100PAIR
NEW-PSTYDICT
)
(setq
PSTYDICT-INFO (dictsearch (namedobjdict) "ACAD_PLOTSTYLENAME")
PSTYDICT-ENAME (cdr (assoc -1 PSTYDICT-INFO))

;; Make an entity definition data list suitable for ENTMAKEX.
;; Start by getting any plotstyle ename from the existing
;; dictionary ... first one found will do:
PS-ENAME (cdr (assoc 350 PSTYDICT-INFO))
;; get the 'template' for a pstyle definition:
XLIST (cdr (entget PS-ENAME))
;; create placeholder (returns ename for new pstyle):
NEW-PLACEHOLDER (entmakex XLIST)

;; Revise the ACAD_PLOTSTYLENAME dictionary definition: insert
;;new (3 . ) and (350 . )
;;before final (100 . <>) and (340 . <>)
TMP-DATLST (cddr (reverse PSTYDICT-INFO))
340PAIR (last PSTYDICT-INFO)
100PAIR (nth (- (length PSTYDICT-INFO) 2) PSTYDICT-INFO)

NEW-PSTYDICT (cons (cons 3 PSTYLENAME) TMP-DATLST)
NEW-PSTYDICT (cons (cons 350 NEW-PLACEHOLDER) NEW-PSTYDICT)
NEW-PSTYDICT (cons 100PAIR NEW-PSTYDICT)
NEW-PSTYDICT (cons 340PAIR NEW-PSTYDICT)
NEW-PSTYDICT (reverse NEW-PSTYDICT)
)
;; Art: "let the dictionary know that it's the new owner.":
(entmod NEW-PSTYDICT)
)

;;; Tests:
;;;(addpstyletodict "Yahoo")
;;;(addpstyletodict "Houynhym")
;;;(princ (dictsearch (namedobjdict) "ACAD_PLOTSTYLENAME"))

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

Post to forums  

Autodesk Design & Make Report

”Boost