Author Topic: Creating object under another..  (Read 2326 times)

0 Members and 1 Guest are viewing this topic.

Andrea

  • Water Moccasin
  • Posts: 2372
Creating object under another..
« on: September 01, 2009, 09:19:17 AM »
Hi all...

Anyone know how to create an object under another without using draworder or cdorder ?

Code: [Select]
(setq MyPLINE  
(entmakex
  (list
    '(0 . "LWPOLYLINE")
    '(100 . "AcDbEntity")
    '(100 . "AcDbPolyline")
    '(90 . 6)
    '(70 . 1)
    '(43 . 0.0)
    '(38 . 0.0)
    '(39 . 0.0)
    (cons 10 p1)
    (cons 10 p2)
    (cons 10 p3)
    (cons 10 p4)
    (cons 10 p5)    
   )
  )
)

(command "._draworder" MyPLINE "" "_A" MyObject "")
Keep smile...

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Creating object under another..
« Reply #1 on: September 01, 2009, 09:26:23 AM »
Maybe you could entmod the object you want on top?
Just a guess.
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

Lee Mac

  • Seagull
  • Posts: 12913
  • London, England
Re: Creating object under another..
« Reply #2 on: September 01, 2009, 09:43:42 AM »
Perhaps use the relevant methods on the Sortents Table?

Example:

Code: [Select]
(defun getOrder  (/ doc spc Dic sort order) 
 
  (setq doc (vla-get-ActiveDocument
              (vlax-get-Acad-Object))
        spc (if (zerop (vla-get-activespace doc))
              (if (= (vla-get-mspace doc) :vlax-true)
                (vla-get-modelspace doc)
                (vla-get-paperspace doc))
              (vla-get-modelspace doc)))
 
  (if (vl-catch-all-error-p
        (setq sort
          (vl-catch-all-apply 'vla-item
            (list
              (setq Dic
                (vla-getextensiondictionary spc)) "ACAD_SORTENTS"))))
    (setq sort (vla-addobject Dic "ACAD_SORTENTS" "AcDbSortentsTable")))

  (vla-getfulldraworder sort 'order :vlax-false)
  (if (< 0 (vlax-safearray-get-u-bound order 1))
    (vlax-safearray->list order)))

Joe Burke

  • Guest
Re: Creating object under another..
« Reply #3 on: September 01, 2009, 09:46:32 AM »
There are vlisp methods which can be used to control draworder. Example: see help regarding MoveToTop method.

Spike Wilbury

  • Guest
Re: Creating object under another..
« Reply #4 on: September 01, 2009, 09:56:12 AM »
edit...

i remember in the old days, the use of the command copy and move and using as the base point the 0,0,0
« Last Edit: September 01, 2009, 10:07:33 AM by Esquivel »

Andrea

  • Water Moccasin
  • Posts: 2372
Re: Creating object under another..
« Reply #5 on: September 01, 2009, 10:31:43 AM »
well...thanks all...

I've made many test for DiLEADER program...
and I can't understand why the result is working alternatively....
see the animated Gif..

I have tried with Wipeout,Solid and LWpolyline..but the result still the same..  :|

(I have put a blue color to let you see what it's happen..)

Keep smile...

Andrea

  • Water Moccasin
  • Posts: 2372
Re: Creating object under another..
« Reply #6 on: September 01, 2009, 11:16:45 AM »
Fixed !

Thanks again all..
i'll upgrade the routine soon.. :wink:

Keep smile...

Lee Mac

  • Seagull
  • Posts: 12913
  • London, England
Re: Creating object under another..
« Reply #7 on: September 01, 2009, 11:18:16 AM »
What was the solution Andrea?  Or are we going to have to wait for the update...  ;-)

Andrea

  • Water Moccasin
  • Posts: 2372
Re: Creating object under another..
« Reply #8 on: September 01, 2009, 11:49:45 AM »
What was the solution Andrea?  Or are we going to have to wait for the update...  ;-)

I've made a mistake creating object order vs Modified object.. :lmao:
but I take your sortents code as a snipet.

thanks.  ;-)
Keep smile...

Lee Mac

  • Seagull
  • Posts: 12913
  • London, England
Re: Creating object under another..
« Reply #9 on: September 01, 2009, 11:51:33 AM »
I see - no worries :-)

Looking forward to the next DiLeader update  :-)