Visual LISP, AutoLISP and General Customization

Visual LISP, AutoLISP and General Customization

Reply
Distinguished Contributor lai
Distinguished Contributor
lai
Posts: 123
Registered: ‎08-15-2011
Message 21 of 24 (382 Views)

Re: Some lisp modification for coordinate setting

05-13-2012 07:15 PM in reply to: Moshe-A

Hi Moshe,

sorry for late reply.I just try you new revise lisp..I would like to give some further more customization. I have prepare the attachment for your better understanding..I wish to have a lisp that can give me 3 options to choose...i will create my own button.

 

By the way, i notice when i once start your lisp, i get this msg..

 

Command:

Command: cxy3



leader style -> Row/Column <One>:  (I wish to eliminate this step in the revise lisp)



Leader 1st point:

Leader 2nd point:

Pick text location:  <Ortho on>

Command:

 

If there any doubts, maybe you can direct email me at lai@dre.com.my

Distinguished Mentor
Moshe-A
Posts: 829
Registered: ‎09-14-2003
Message 22 of 24 (342 Views)

Re: Some lisp modification for coordinate setting

05-19-2012 06:33 AM in reply to: lai

Lai,

 

i have attached the new mxp.lsp (which is a cxy.lsp reviced). this version is much more sophisticated an flexible.

 

the program contains 4 autocad commands for your uses.

m2p, m2p-, m3p, m3p-

the number (of course) signifies the number of leaders points.

 

As you know?!  mleader objects are created base on mleaderstyle and it has a Landing property.

to accomplish your requests, the lisp is automaticlly creates two new mleaderstyles:

 

the first called Landing_off  (with no landing line)

and a second called Landing_on (with landing line)

 

m2p  / m3p    uses Landing_off mleaderstyle and

m2p- / m3p-   uses Landing_on   mleaderstyle

(with dash character signifies the landing line)

so actually you can control it by calling the right command.

 

the two mleaderstyles are created only if they are not exist and you can (if you need)

make more changes to its properties.  the next time you call the commands? it will

use the existing mleaderstyle (including your modifications)

be aware that the scale for mleaderstyle is left 1.0 and you need to set it for your dwg scale

and if you make changes to the mleaderstyle? it will immediatly effect all mleader objects that

are already drawn. (you can not draw at the same dwg two different mleader scale)

the two mleaderstyles will use the current textstyle at creation time.

 

each command will issue the following prompt:

Coords style -> Row/Column <Row>:

 

i do remembere  your request to eliminate it but it is not logical to do so, it gives you the flaxiability

to use Row or Coulmn Style with each of command.

 

in order to eliminate the need to reply each time to this prompt you can define your

own toolbar buttons (do you know how to do it?) and put such macros there

 

[2 points without landing line]

^C^Cm2p Row                            ; Row       is selcted automaticlly

^C^Cm2p Column                     ; Column is selcted automaticlly

 

[2 points with landing line]

^C^Cm2p- Row                            ; Row       is selcted automaticlly

^C^Cm2p- Column                     ; Column is selcted automaticlly

 

[3 points without landing line]

^C^Cm3p Row                            ; Row       is selcted automaticlly

^C^Cm3p Column                     ; Column is selcted automaticlly

 

[3 points with landing line]

^C^Cm3p- Row                            ; Row       is selcted automaticlly

^C^Cm3p- Column                     ; Column is selcted automaticlly

 

 

also note from your picture:

 

the M3PTYP1 is not really a mleader with 3 points you can accomplish it by 2 points with landing line ( my m2p- )

and set the Coords style to Coulmn

 

the M3PTYP2 is not really a mleader with 3 points you can accomplish it by 2 points with landing line ( my m2p- )

and set the Coords style to Row

 

if you need a longer landing line then what is sets in mleaderstyle you can use the m3p- command.

 

and finaly some limitations:

*  the lisp will work only from R2008 and up (as far as i recall mleader is not supported below)

*  a limitation in the vla functions prevent visual lisp from creating new mleaderstyle

    in R2008 so better running it from R2009 and up. although it will run in R2008 but it will only

    use the current mleaderstyle which is not really suitable.

 

 

Cheers,

Moshe

 

Distinguished Contributor lai
Distinguished Contributor
lai
Posts: 123
Registered: ‎08-15-2011
Message 23 of 24 (328 Views)

Re: Some lisp modification for coordinate setting

05-20-2012 05:28 PM in reply to: Moshe-A

Hi Moshe,

Thanks alot for the newly revise lisp..it's works great and just as what i needed...Anyway, i tot to have some minor modification..Can i make all the new multileaders to just follow the current drawing multileader? Reason is to prevent any further multileader modification. I think if just change it to follow my current multileader rather than let it autocreate a new one is more better.

Distinguished Mentor
Moshe-A
Posts: 829
Registered: ‎09-14-2003
Message 24 of 24 (322 Views)

Re: Some lisp modification for coordinate setting

05-20-2012 11:03 PM in reply to: lai

Lai,

 

of course what you are asking can be done but it's alot of work cause the dxf codes for mleadetstyle

 in developer documentation are confusing. only to achieve what i gave you took me alot of time.

i used triel and error to match the right codes.

 

what i'm suggesting you is to define properly the Landing_off and Landing_on mleaderstyles

and put them in a template file (dwt) and then import them (with ADCenter) to any dwg you work.

 

again note:

the Commands only creates it's mleaderstyles only if they are no exist.

and they are both needed for a proper work (do not mix them)

the Landing_off mleaderstyle is not realy disabling the landing line it only define a very small landing length

 

Moshe

 

 

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.