(vl-load-com)
(defun c:test (/ ent)
(setq Ent (car (entsel "\nSelect Profile View: ")))
(and (setq *acad* (vlax-get-acad-object))
(setq C3D (strcat "HKEY_LOCAL_MACHINE\\" (if vlax-user-product-key (vlax-user-product-key) (vlax-product-key) ) )
C3D (vl-registry-read C3D "Release")
C3D (substr C3D 1 (vl-string-search "." C3D (+ (vl-string-search "." C3D) 1) ) )
C3D (vla-getinterfaceobject *acad* (strcat "AeccXUiLand.AeccApplication." C3D) ) )
(setq C3Ddoc (vla-get-activedocument C3D))
)
(setq settings (vlax-get c3ddoc 'settings))
(setq pvcmdsettings (vlax-get settings 'profileviewcommandssettings))
(setq createpvsettings (vlax-get pvcmdsettings 'createprofileviewsettings))
(setq stylesettings (vlax-get createpvsettings 'stylesettings))
(vlax-put (vlax-get stylesettings 'style) 'value "Full Grid");;The stylename must exist!!!
(princ))
(defun C:Test ()
(C:test1) ;;Select the profile view to change the style without the grid
(command" "-layer" "OFF" "C-STRC-LABL,C-PIPE-LABL,C-PROF-LABL" "")
(command "-bhatch" "p" "ansi31" "30" "0" pause "")
(command" "-layer" "ON" "C-STRC-LABL,C-PIPE-LABL,C-PROF-LABL" "")
(C:test2) ;;Select the profile view to change the style back to the grid
(princ))