;|lisp to help with line/arc labeling to avoid using the stock C3D
style selection form.
By: Jeff Mishler, Quux Software...Creators of the Sincpac-C3D add-on package
|;
;;Example macro for a toolbar/toolpalette button
;;(quuxaddlabel "Distance Only" "Distance Only")
(defun quuxaddlabel
(linestyle2use arcstyle2use
) (setsgmntlblstyle linestyle2use arcstyle2use)
)
;; note that the label styles MUST exist or it will puke
;; suggest adding error handling to help with that
;; pass the line label style name and arc label style name
(defun setsgmntlblstyle
(linestyle2use arcstyle2use
/ *ACAD
* C3D C3DDOC sgmntCMDSETS sgmntLBLSETS sgmntSTYLE SETS STYLESETS
*error*)
(defun *error* (msg
/ tmp
) )
)
(list sgmntCMDSETS sgmntLBLSETS sgmntSTYLE SETS STYLESETS c3ddoc c3d
*acad
*)) )
)
(if vlax
-user
-product
-key
(vlax-user-product-key)
)
)
C3D
(vl
-registry
-read C3D
"Release") 1
"."
C3D
)
)
*acad*
(strcat "AeccXUiLand.AeccApplication." C3D
) )
)
)
(setq sgmntcmdsets
(vlax-get sets 'generalcommandssettings
)) 'AddSegmentLabelSettings
)
)
(vlax-put arcsgmntstyle 'value arcstyle2use
) (vlax-put linesgmntstyle 'value linestyle2use
) (*error* nil)
)
)
)
[code]
[code=cadlisp-7]
(defun setsurfspotlblstyle
(style2use
/ *ACAD
* C3D C3DDOC PROD PRODSTR SETS
SPOTLBLSETS SPOTSTYLE STYLESETS SURFCMDSETS
*error*)
)
)
(list SPOTSTYLE STYLESETS SPOTLBLSETS SURFCMDSETS SETS c3ddoc c3d
*acad
*)) )
)
(if vlax
-user
-product
-key
(vlax-user-product-key)
)
)
C3D
(vl
-registry
-read C3D
"Release") 1
"."
C3D
)
)
*acad*
(strcat "AeccXUiLand.AeccApplication." C3D
) )
)
)
'AddSurfaceSpotElevLabelSettings
)
)
(setq spotstyle
(vlax-get stylesets 'spotelevationlabelstyle
)) (*error* nil)
)
)
)
;;usage, note that the label style MUST exist or it will puke
;; suggest adding error handling to help with that
;;(setsurfspotlblstyle "+NOPLOT Spot - JS")