How to getpoint in hatch

Discussion in 'AutoCAD' started by Adesu, Jul 27, 2004.

  1. Adesu

    Adesu Guest

    I would create hatch in the program lisp,but got trouble in to find
    getpoint,at the command prompt always say "select object",can anyone's help
    to solve this problem,thanks a lot.
    Best regards
    Ade Suharna

    ( loc2 (polar loc1 (dtr 45) 2.0))
    (command "_hatch" "ansi31" (getvar "zoomfactor") 0 (getpoint loc2) ""
    "")
     
    Adesu, Jul 27, 2004
    #1
  2. Adesu

    Joe Burke Guest

    Adesu,

    I think you want to use (command "_-bhatch" ... ) That's the command line version of
    boundary hatch.

    Joe Burke
     
    Joe Burke, Jul 27, 2004
    #2
  3. All sorts of problems with your code.

    ( loc2 (polar loc1 (dtr 45) 2.0)) ; where is the setq?

    (command "_hatch" "ansi31" (getvar "zoomfactor") 0 (getpoint loc2) ""
    "")

    Did you run this sequence from the command line manually? What happens when
    you get to the 4th prompt while using the command manually? Are you able to
    pick simply a point? (Joe is correct in his post there.)

    Once you get the correct command, you still have another issue.
    (getpoint loc2) ; what is your intention here? Do you really want the user
    to select a point? What does the documentation tell you about this function?


    --
    R. Robert Bell


    I would create hatch in the program lisp,but got trouble in to find
    getpoint,at the command prompt always say "select object",can anyone's help
    to solve this problem,thanks a lot.
    Best regards
    Ade Suharna

    ( loc2 (polar loc1 (dtr 45) 2.0))
    (command "_hatch" "ansi31" (getvar "zoomfactor") 0 (getpoint loc2) ""
    "")
     
    R. Robert Bell, Jul 27, 2004
    #3
  4. Also you might want to ask the question first -
    ( loc2 (polar loc1 (dtr 45) 2.0))
    (setq loc3 (getpoint loc2 "\nPick Location for Hatch ? "))
    (command "_-bhatch" "ansi31" (getvar "zoomfactor") 0 loc3 "")
     
    Alan Henderson @ A'cad Solutions, Jul 27, 2004
    #4
  5. Adesu

    spencer1971 Guest

    Adesu

    If you use the following it will allow for input of multiple points with a return to complete hatch..

    (princ "\nSelect area to hatch")
    (initdia)
    (command "-bhatch") (while (> (getvar "CmdActive") 0)(command
    pause))

    as posted by Jason Piercey.
     
    spencer1971, Jul 27, 2004
    #5
  6. Adesu

    Adesu Guest

    Sorry I 'm not completed post,here is

    (setq loc2 (polar loc1 (dtr 45) 2.0))
    (command "_hatch" "ansi31" (getvar "zoomfactor") 0 (getpoint loc2) ""
    "")
    I would not use "user input" or "pause",but I want automatic program click
    it self,at "loc2" !!
    any idea ??
     
    Adesu, Jul 28, 2004
    #6
  7. What does the documentation, AutoLISP Reference, tell you about the
    (getpoint) function?

    --
    R. Robert Bell


    Sorry I 'm not completed post,here is

    (setq loc2 (polar loc1 (dtr 45) 2.0))
    (command "_hatch" "ansi31" (getvar "zoomfactor") 0 (getpoint loc2) ""
    "")
    I would not use "user input" or "pause",but I want automatic program click
    it self,at "loc2" !!
    any idea ??
     
    R. Robert Bell, Jul 28, 2004
    #7
  8. Adesu

    Adesu Guest

    Hi Joe, I've got success to hatch it,but still problem to add "ansi31"
    "scale" and "rotation",how to do it,can you help me,thanks a lot for your
    kind.

    (setq loc2 (polar loc1 (dtr 45) 2.0))

    (command "_bhatch" "p" "s" loc2 "")
     
    Adesu, Jul 29, 2004
    #8
  9. Run -BHatch at the command prompt. Check out your options. Remember, some
    dialog-based commands have a command-line interface when you prefix the
    command name with a dash (-).

    --
    R. Robert Bell


    Hi Joe, I've got success to hatch it,but still problem to add "ansi31"
    "scale" and "rotation",how to do it,can you help me,thanks a lot for your
    kind.

    (setq loc2 (polar loc1 (dtr 45) 2.0))

    (command "_bhatch" "p" "s" loc2 "")
     
    R. Robert Bell, Jul 29, 2004
    #9
  10. Adesu

    Joe Burke Guest

    Adesu,

    I was only suggesting if you want to place a hatch pattern by specifying a point, use
    the "-bhatch" command rather than "hatch".

    See Robert's following comments regarding what comes after (command "-bhatch" ...
    Basically you have to play with the command line version in the drawing editor to
    understand what arguments your LISP command function needs. It's not easy for someone
    here to tell you exactly what the sequence should be because the options presented at
    the command line vary, depending on which option was chosen previously.

    Joe Burke
     
    Joe Burke, Jul 29, 2004
    #10
  11. Adesu

    MP Guest

    (setq existPattern (Getvar"HPNAME"))
    (setvar "HPNAME" "ANSI31")
    (setq existScale(Getvar"HPSCALE"))
    (setvar"HPSCALE" 0.25)
    (setq existAngle(Getvar"HPANG"))
    (setvar "HPANG" 30)
    ....do hatch

    .... then reset values to existing if desired

    hope that helps
    Mark
     
    MP, Jul 29, 2004
    #11
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.