WBlock Invalid Point

WBlock Invalid Point

DGCSCAD
Collaborator Collaborator
760 Views
9 Replies
Message 1 of 10

WBlock Invalid Point

DGCSCAD
Collaborator
Collaborator

Hello all,

 

I hope I'm missing something obvious here, but given the following:

 

Vars:

blk_str = "C:\\Temp\\temp_block"

BL_1 = (241.169 20.1094 0.0)

blk_ss = <Selection set: a51> (a valid selection set)

 

Function:

(command "_.wblock" blk_str "" BL_1 blk_ss "")

 

Pasting the function to the command line works, but not when I use it in code. When I run it in a function call with a while loop it doesn't like the BL_1 point list for some reason and keeps erroring out with:

 

Specify insertion base point:
Invalid point.
; error: Function cancelled

 

Even if I hard code the base point to 0,0.

 

Not sure what I'm missing?

AutoCad 2018 (full)
Win 11 Pro
0 Likes
Accepted solutions (1)
761 Views
9 Replies
Replies (9)
Message 2 of 10

LDShaw
Collaborator
Collaborator

Sounds like BL_1 is not passing through. 
See if this works. 

(setq BL_1 (list 241.169 20.1094 0.0))

 

0 Likes
Message 3 of 10

ec-cad
Collaborator
Collaborator

If you just paste that code to the Command Prompt, what is the resulting 'Blockname' ?

And, for the path, you need a "\\" on the end, I would think.

You could also try attached for 'normal' blocks.

 

ECCAD

 

0 Likes
Message 4 of 10

DGCSCAD
Collaborator
Collaborator

@LDShaw wrote:

Sounds like BL_1 is not passing through. 
See if this works. 

(setq BL_1 (list 241.169 20.1094 0.0))

 


I have tried that with no success. Even if it's hard coded as in:

 

(command "_.wblock" blk_str "" '(0 0 0) hv_blk_ss "")

 

It still tells me it's an invalid point.

 

It's in a while loop that iterates through a selection of entities. It doesn't seem like that would make any difference as to why it's rejecting a hard coded point.

AutoCad 2018 (full)
Win 11 Pro
0 Likes
Message 5 of 10

ec-cad
Collaborator
Collaborator

Are your 'Limits' ON ?

 

ECCAD

0 Likes
Message 6 of 10

DGCSCAD
Collaborator
Collaborator

Thanks for the replies.

 

Limits are off.

 

I'm fairly certain it has something to do with the while loop.

 

This is a function that iterates through a sel set to find all polylines of a certain length (a titleblock border), then uses that polyline boundingbox (BL/UR) to grab another sel set to find each table style name (titleblock), which is used as part of the block name. The 2nd sel set is also the wblock entities, and the BL (bottom left) point of the boundingbox is the insertion point of the wblock. All variables check out fine when princ-ing them to the command line just before the wblock command call, but even hard coding the ins point to 0,0 isn't working, so it's got me scratching my head.

 

This is a utility function to aid in a bigger program that pulls in the wblocks based on eight Yes or No choices. Thats 256 permutations of 10 to 15 drawings for each set of choices I need to wblock out. The "choices" are coded into a wblock name suffix (Y-N-N-Y etc. appened to the wblock name) and also a directory name which is created. This would speed things up a bit by being able to set the drawings up, then select them all and have the function do the rest. I am whittling down the 256 permutations by setting a couple things, via layers and such, post insert. Each choice I can eliminate halves the permutations, but I'm still working that out.

 

I was hoping the point error was just a simple oversight on my part, but it seems to not be the case here. If I get some time, I'll post the code and entities.

 

Again, thank you for looking into it.

AutoCad 2018 (full)
Win 11 Pro
0 Likes
Message 7 of 10

komondormrex
Mentor
Mentor

hey,

try changing the command function to command-s or vl-cmdf.

0 Likes
Message 8 of 10

DGCSCAD
Collaborator
Collaborator

Both command-s and vl-cmdf return "Invalid point".

AutoCad 2018 (full)
Win 11 Pro
0 Likes
Message 9 of 10

komondormrex
Mentor
Mentor

could you show this code fragment with the loop causing the error?

0 Likes
Message 10 of 10

DGCSCAD
Collaborator
Collaborator
Accepted solution

It was an sssetfirst call mucking up the works. I was using an sssetfirst to grab all entities, then running an implied "_i" sel set to grab the polylines and run a while loop to grab the other data. I think the problem was that I wasn't nulling out the sssetfirst so it was taking precedence over the command call. 

 

Sending the polyline ent names to a list then running a foreach on the list cleared it up.

 

 

AutoCad 2018 (full)
Win 11 Pro
0 Likes