Jump to content

Recommended Posts

eimimitu

(setq axd (vla-AddDimAligned spc d1 d2 ex))
(vla-Copy axd)
(vl-cmdf "_.explode" "_l" "") ;could not find an ActiveX equivalent for this
(setq del (ssget "_p")) ;errors here, does not set the variable and exits routine

 

Can someone shed some light? What is the deal with the above?

I am able to type the last expression at the command line after error and it sets the variable fine, so it seems to recognize the previous entities after lisp exits but not during for some reason.

 

Also, is there a way to explode dims other than the command method?

 

Thanks in advance!

Share this post


Link to post
Share on other sites
Grrr

Try with:

 

(setq e (entlast))
(setq axd (vla-AddDimAligned spc d1 d2 ex))
(command "_.EXPLODE" (ssadd (vlax-vla-object->ename axd))  "")
(setq SS (ssadd))
(while (setq e (entnext e)) (ssadd e SS))
(sssetfirst nil SS)

 

Looks like IAcadDimAligned doesn't have Explode method, so you'll have to stick with the command approach.

Share this post


Link to post
Share on other sites
eimimitu

That did it Grrr... million thanks.. I'm was even able to iterate and process selection without the need for ssget or ssadd thanks to your tip! Bummer about the explode command... though..:glare:

Share this post


Link to post
Share on other sites
Lee Mac

Exploding dimensions!?! :shock:

Share this post


Link to post
Share on other sites
eimimitu

I was waiting for that...:lol:

 

Exploding the copy of the original to be fair...;)

 

Only to extract the arrow blocks and manipulate them to look like they are in isometic view... working on iso projection dimensioning...

Share this post


Link to post
Share on other sites
Grrr

I tought the same as Lee,

Alternatively would be to extract the Arrowhead1Block and Arrowhead2Block properties and insert the blocks at ExtLine1Point and ExtLine2Point property-points (or something like this).

I would be careful when using Explode, so I'd use Undomarks/*error* function in my routine.

Share this post


Link to post
Share on other sites
Lee Mac
Only to extract the arrow blocks and manipulate them to look like they are in isometic view... working on iso projection dimensioning...

 

You could alternatively iterate over the dimension block definition, e.g.:

(defun c:test ( / blk ent enx )
   (if
       (and
           (setq ent (car (entsel "\nSelect dimension: ")))
           (setq enx (entget ent))
           (wcmatch (cdr (assoc 0 enx)) "*DIMENSION")
           (setq blk (tblobjname "block" (cdr (assoc 2 enx))))
       )
       (while (setq blk (entnext blk))
           (print (cdr (assoc 0 (entget blk))))
       )
   )
   (princ)
)

 

Also refer to my LM:getdimstring function.

Share this post


Link to post
Share on other sites
eimimitu

I considered this approach... Only issue is that most commonly used arrowhead is "Closed Filled" which, in my version of ACAD at least, is not a block definition at all but a solid... Any suggestions for solving this?

 

So instead of vla-getting Arrowhead1or2Block, inserting it on screen and modifying it, I opted for exploding a copy of the final dimension, extracting arrows and erasing/purging all the leftovers... Not ideal because of having to call the command but works pretty good. I'm also forced to call other commands, specifically "DIMALIGNED" because vla-AddDimAligned doesn't create an object associated dimension as far as I understand. I also could not find any method to associate after creation as in the "DIMREACCOSIATE" command.

 

A bit off topic but, quick question for you lisp masters..

What can you tell me about stacked fractions in fields...

As far as I know there's no standard option for this...

Theoretical solution which I haven't really looked into is Diesel Expressions in combo with Formatting Codes (Lee's routine reminded me of it)

Uses would be:

Viewport scale, Height of an Extrusion, Coordinate Point Position and such

I want to be able to match standard format for my drawings which is all fractions stacked

I want to use fields for its auto update capability

Any workaround that you can think of?

Just thought of another theoretical solution: Fields to mtext string in combo with object reactor???? (just spitball-ing but..)

Share this post


Link to post
Share on other sites
Lee Mac
I considered this approach... Only issue is that most commonly used arrowhead is "Closed Filled" which, in my version of ACAD at least, is not a block definition at all but a solid... Any suggestions for solving this?

 

You misunderstood.

 

I am not referring to the block definition of the arrowhead, but the block definition of the dimension itself - this will apply to all dimensions, regardless of the arrowhead used.

 

Did you try my code with your dimensions?

Share this post


Link to post
Share on other sites
eimimitu

ooh I think I'm following now... you're approach iterates to the original dimension without needing to explode it... then it's a matter of extracting the needed entities from the block definition itself.. Yes?

 

what method would you use to extract arrows...?

 

(vla-copy (vlax-ename->vla-object blk))

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×