Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

Inventor sketch block will not delete

william
Advocate

Inventor sketch block will not delete

william
Advocate
Advocate

Hello 

I have a part file that keeps giving errors on new features, basic extrudes, etc. After digging into it, it appears to be a single sketch block & associated parameters that are the problem. 

 

I have tried every way i can think of to delete the parameters and the sketch block, it it refuses to be deleted. 

 

I have stripped the part right back to only containing the sketch block, no other parameters, sketches, or features and it still will not delete. 

 

I really dont want to create a new part and spend 3-4hrs rebuilding the part from scratch because of 1 sketch block. 

 

Can anyone figure this out? 

0 Likes
Reply
Accepted solutions (2)
3,867 Views
26 Replies
Replies (26)

kimK7B54
Advocate
Advocate

@kimK7B54 wrote:  (reply to add missing images)
That does not work.

This is the only dimension it brings in, and it is not a needed dimension.

I need to be able to "auto-populate" some these variables.  This would
change a 2 hour job into a 5 minute job.

Currently I have to manually find these ( in a list of up to 50
iFeatures, locate the correct one, and insert the value )

I have to go to the model to identify which iFeature I am detailing,
then back to the idw;  Very, very time consuming.


import model parameters.pngparameters needed.png

0 Likes

johnsonshiue
Community Manager
Community Manager

Hi! It seems like a bug or a limitation in the iFeature. I suggest you start a new thread with the iFeature ide file and the source ipt file extracting the iFeature. I would like to understand why the iFeature parameters are not being retrieved in the drawing.

Many thanks!

 



Johnson Shiue (johnson.shiue@autodesk.com)
Software Test Engineer
0 Likes

aperrone_lc
Explorer
Explorer

I didn't have much luck with @bradeneuropeArthur 's solution, but I figured out why. My offending "phantom sketch" wasn't at index 1. I used the following modification of Arthur's code to figure out the index I needed to kill:

 

Dim a As PartDocument = ThisDoc.Document

MsgBox(a.ComponentDefinition.Sketches.Count)

For i = 1 To a.ComponentDefinition.Sketches.Count:
	MsgBox(a.ComponentDefinition.Sketches.Item(i).Name)
Next

a.ComponentDefinition.Sketches.Item(2).Delete

 

Note that I ran this once, then modified line 9 to delete the correct index. There doesn't seem to be any harm in getting the index wrong on the first run-through; it'll just throw an error. Also, this will get annoying on a large model. Mine only had 3 or 4 sketches, so it was quick to run through the repeating message boxes. There is surely a more elegant solution to be had.

0 Likes

RobNZIFSL
Contributor
Contributor

I have a master part containing around thirty blocks, perhaps half of those nested.  Copying out the required blocks (all but the two I want to delete) is not a viable solution due to derived components dependency on the master part.

 

I want to delete the two blocks shown below.  You can see one is nested into the other.  I have edited the 'parent' to window select all content and then deleted that content; this has not removed the 'child' block.  I have also run the above code without improvement.

 

RobNZIFSL_0-1717967969601.png

 

I believe it could be resolved by removing the implied parent child reference but don't know how to do this.  Any thoughts?

0 Likes

johnsonshiue
Community Manager
Community Manager

Hi Rob,

 

This could be a corruption. Somehow the sketch block is still referenced by a ghosted sketch. Please share the file here or send it to me directly johnson.shiue@autodesk.com. I can take a look to see if it is indeed a corruption and it can be purged.

Many thanks!



Johnson Shiue (johnson.shiue@autodesk.com)
Software Test Engineer
0 Likes

msonderegger
Participant
Participant

I have a similar situation...a certain block will not delete.  It appears to be causing a bunch of style library XML issues in 2025 which we just "migrated" to.  Of course, this ancient file with this block error spawned most of our graphics & label files over the years, so the error prone block is spread throughout several files at this point.  I have deleted everything from within the block...no change, and still can't delete it. Even once I delete everything in the part, I still can't delete this one block.  

ILOGIC CODE: 

I did successfully use that ilogic code, but it only worked after I deleted everything I could from my file.  On a positive note, sure enough after running that code, I was then able to delete the block.  However, I feel like I have just created a "new file", since its completely empty?  Was this the intent?  I'm unclear how this is useful?  Maybe the hope is to copy everything back into that file with a little copy-paste magic (and hours of frustration and direction guessing in the absence of a graphical illustration of previous references like other CAD SW had decades ago)?  Anyhow, in my case, the first feature in these parts is typically a DERIVE, so I have no means to go grab a copy of the problem file and copy everything over - DERIVES don't seem to copy & paste AFAIK.  So, FILE-NEW, recreate everything, and replace the bad files everywhere with the new ones is certainly an option I was aware of long before reading this thread...but...I guess I was hoping for more.  Anyone with insights?  What am I missing?

0 Likes

bradeneuropeArthur
Mentor
Mentor

Could you share a file without cleaning up?

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background
Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !

0 Likes