Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

sectionobject parameters

18 REPLIES 18
SOLVED
Reply
Message 1 of 19
mrkaplan
773 Views, 18 Replies

sectionobject parameters

how do i save my parameters to defaults ?

each time i create a sectioonplane i have to change hatch type , scale , and other things .

18 REPLIES 18
Message 2 of 19
pbejse
in reply to: mrkaplan

Depending on the TYPE of variable

(defun c:test ()
(setq Value
  (cond
    ((getint (strcat "\nChoose a Number <"
          (itoa (setq Value
              (cond ( Value ) ( 1 ))))
          ">: "
        )
      )
    )
    (Value)
  )
)
)

 

 

Try it

Message 3 of 19
stevor
in reply to: mrkaplan

1. To set the initial value of the variable: ( If (not value) (setq value 123)) where you use your own initial value instead of 123.... 2. A subroutine is often used for the statements to get a new value from the user, like (Defun Get_I (d ps / a ) (setq d (if (and d (= 'INT (type d))) d 0) a (getint (strcat " " ps " < " (itoa d) " > " )) ) (if a a d ) ) ; ...... where d is the default value, and ps is the prompt string, as "\nChoose a Number " in the example by pbejse.....Other similar subroutines at http://auscadd.com/free-lsp-0.html. 3. And there are 2 forms of variable persistence, local and global, so you can set a global variable from inside or outside a defun'ed routine and use it for various jobs. .... 4. And many people use a unique character to identify the global variables, I use the * help me remember.
S
Message 4 of 19
mrkaplan
in reply to: mrkaplan

i could try a simple lisp routine and add it to acaddoc .

the problem is i dont know what variables control sectionobject parameters ( ie hatch pattern , color , scale , hidden lines etc )

 

also  , i take from your replies  there is no way to do this through the interface , options , cui or else

Message 5 of 19
pbejse
in reply to: mrkaplan

Can you give an outline or a brief description of what you want to achieve.

 

 

Message 6 of 19
mrkaplan
in reply to: pbejse

i want sectionobject default settings to be  :

hatch ansi31 ,  scale 3,  color red

tangent lines hidden

Message 7 of 19
Lee_Mac
in reply to: mrkaplan

My tutorial here may be of some help with regard to prompting with a default.

Message 8 of 19
scot-65
in reply to: mrkaplan

To globally remember settings (meaning applies to all drawing files), look into

VL-REGISTRY-READ, VL-REGISTRY-WRITE, VL-REGISTRY-DELETE.

You will have to initialize these values inside your ACADdoc.lsp (or similar).

Create your own section in the registry (meaning do not add to an existing tree),

and make sure to verify the entries exist in the registry before fetching the values.

HKCU\Software\My_AutoCAD_Settings is a start.

 

Better yet, do as others above suggest - set values inside ACADdoc.lsp.

Avoid the registry to store data whenever possible...

 

For single instance to remember values (meaning apply to this drawing file only), look into

VLAX-LDATA-GET, VLAX-LDATA-PUT, VLAX-LDATA-DELETE.

These are called Dictionary items. Suggest keeping the entries to a minimum by using LISTs

and accessing the values using NTH...

 

???


Scot-65
A gift of extraordinary Common Sense does not require an Acronym Suffix to be added to my given name.


Message 9 of 19
mrkaplan
in reply to: mrkaplan

thanks for your input . my question is still unanswered :

what variables ( if they exist )  control  :

 

section object intersection fill hatch pattern 

section object intersection fill hatch color

 

section object background lines display

section object background lines hidden display 

 

section object forefront lines display

section object forefront lines hidden display

 

section object tangent lines display

 

then of course , if those settings can be found in the user interface , id also be interested to know . 

thanks 

Message 10 of 19
kefer_kb
in reply to: mrkaplan

Hi,

do you mean the standart hatch settings, stored in ACAD system variables HPNAME, HPSCALE and HPCOLOR ?

Take a look to all system variables, maybe you can find your request.

 

Which ACAD command do you use?

 

kind regards,

Franz

www.gfm.at
Message 11 of 19
mrkaplan
in reply to: kefer_kb

please read again my previous post  . 

section object settings ar not controlled by hpname hpscale  or hpcolor otherwise it would be a simple matter

Message 12 of 19
kefer_kb
in reply to: mrkaplan

Save a simple drawing in DXF format and search for actual sectionobject values. So you can see where it was stored (variable area, tables, dictionaries, ...)

www.gfm.at
Message 13 of 19
mrkaplan
in reply to: kefer_kb

 Tried your suggestion and opened a dxf file with a sectionobject in it using notepad .  there are a couple of interesting headers   ( "sectionobject" or  "section_settings")  but i didnt see anything obvious related to hatch pattern and scale

Message 14 of 19
kefer_kb
in reply to: mrkaplan

Be so kind and post a DXF sample file. Maybe other forum visitor or i can help you better.

www.gfm.at
Message 15 of 19
mrkaplan
in reply to: kefer_kb

here is an example file

Message 16 of 19
mrkaplan
in reply to: mrkaplan

trying to refresh this topic ...
still no easy solution for autocad to remember setionplane / sectionobject default parameters ?
Message 17 of 19
mrkaplan
in reply to: mrkaplan

even " apply changes to all section objects " is broken - nobody seems to notice - starting to wander, am i the only one to use this 😕

Message 18 of 19
t.leonhardt
in reply to: mrkaplan

The easiest way to store sectionsettings is to put the sectionobject in a toolpalette. From there you can drop it into drawing and the settings are restored.

 

If you familiar with lisp there is another way:

1. grab the sectionobject 

2. get the settings for the 2d-section

 

(setq a (vlax-ename->vla-object (car (entsel))))
(setq b (vla-GetSectionTypeSettings (vla-get-settings a) acSectionType2dSection))
(vlax-dump-object b)

With (vlax-dump-object b) you can see all the properties you can manipulate.

With (vla-put-IntersectionFillHatchPatternName b "Ansi31") for instance you can set the hatch to "Ansi31".

 

 

 

Message 19 of 19
mrkaplan
in reply to: t.leonhardt

tool palette works great . thanks

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

Post to forums  

Autodesk Design & Make Report

”Boost